{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Agent Bench UCP checkout profile",
  "description": "The body of create_checkout. quote_hash is optional and, when present, held to the seller's own recomputation (check 7); correlation_id is the buyer's transaction id. With the external mandate, the mandate travels beside these fields as mandate_jws (the first format) or, since 2026-09-13, as mandate_ap2 (the AP2 v0.2 form: two Delegate SD-JWT chains); exactly one of the two, else checkout_invalid. exercise is the caller's statement that the call is a test vector; it is copied into the ledger as facts.claimed_exercise and read by no check.",
  "type": "object",
  "required": [
    "quote_id",
    "merchant_id",
    "currency"
  ],
  "properties": {
    "quote_id": {
      "type": "string",
      "minLength": 8
    },
    "quote_hash": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "merchant_id": {
      "type": "string",
      "const": "demo-travel-seller"
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
    },
    "correlation_id": {
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
    },
    "mandate_jws": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",
      "description": "The cart-stage mandate from an authority on MANDATE_ISSUERS, typ mandate+jwt. Required on the signed-envelope path (checks 4 to 10); first accepted live on 2026-09-11 from https://sealedby.dev."
    },
    "exercise": {
      "type": "string",
      "pattern": "^[A-Z]{1,2}-[0-9]{2,3}[a-z]?$",
      "description": "Optional. A test-vector id (R-06, F-08). The caller's claim, recorded as facts.claimed_exercise in every entry this call writes; changes nothing about how the call is checked. A malformed value is refused as request_invalid, like a malformed correlation_id."
    },
    "mandate_ap2": {
      "type": "object",
      "required": [
        "checkout",
        "payment"
      ],
      "additionalProperties": false,
      "properties": {
        "checkout": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_.-]+(~[A-Za-z0-9_-]*)*~~[A-Za-z0-9_.-]+(~[A-Za-z0-9_-]*)*~$",
          "description": "The Checkout Mandate chain: the authority's open root (`<jwt>~<disclosure>~...`, trailing `~` dropped at the join), `~~`, the buyer's closing hop (`<jwt>~<disclosure>~...~`, typ kb+sd-jwt, signed by the root's cnf.jwk, aud this seller, nonce the quote's jti, sd_hash over the root). Verified by src/ap2.mjs per mandate-ap2-profile.md §4."
        },
        "payment": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_.-]+(~[A-Za-z0-9_-]*)*~~[A-Za-z0-9_.-]+(~[A-Za-z0-9_-]*)*~$",
          "description": "The Payment Mandate chain, same form, its open root bound to the checkout root by payment.reference and its closed hop naming transaction_id = checkout_hash, the payee, the amount and an opaque instrument."
        }
      },
      "description": "The AP2 v0.2 form of the mandate. First accepted by the seller's tests on 2026-09-13; not yet sent by the buyer (C5)."
    }
  },
  "additionalProperties": false
}
