{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/orboni-com/json-schema/orboni-com-checkout-session-schema.json",
  "title": "CheckoutSession",
  "description": "A checkout session: one payment you wait for.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/orboni-com-openapi.yml#/components/schemas/CheckoutSession",
  "type": "object",
  "required": [
    "id",
    "object",
    "livemode",
    "status",
    "payment_status",
    "amount_total",
    "currency",
    "exchange_rate",
    "amount_received",
    "amount_due",
    "amount_remaining",
    "amount_due_usd",
    "amount_received_usd",
    "amount_refunded",
    "payment_methods",
    "payment",
    "url",
    "success_url",
    "cancel_url",
    "client_reference_id",
    "payment_link",
    "customer_email",
    "customer_email_collection",
    "locale",
    "description",
    "details",
    "appearance",
    "metadata",
    "paid_late",
    "needs_review",
    "review_reason",
    "transactions",
    "dust_count",
    "created",
    "expires_at",
    "completed_at",
    "closed_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^cs_(live|test)_[A-Za-z0-9]{32}$",
      "description": "`cs_live_…` or `cs_test_…`: the prefix is the mode."
    },
    "object": {
      "const": "checkout.session"
    },
    "livemode": {
      "type": "boolean",
      "description": "false for a test session: never fulfil a real order on it."
    },
    "status": {
      "type": "string",
      "enum": [
        "open",
        "complete",
        "expired"
      ],
      "description": "`open` — waiting; `complete` — paid, final; `expired` — its time ran out unpaid (still watched for a late payment). An expired session with `payment_status` `held` is not unpaid: the money is there and waits for your review."
    },
    "payment_status": {
      "type": "string",
      "enum": [
        "unpaid",
        "processing",
        "partially_paid",
        "paid",
        "held"
      ],
      "description": "`unpaid`; `processing` — a transfer is seen, not final yet; `partially_paid` — final but short (the rest is `amount_remaining`); `held` — held for your review (`needs_review`), not to fulfil on yet; `paid` — only ever with `status` `complete`: fulfil on it."
    },
    "amount_total": {
      "type": "integer",
      "description": "What you asked, in the currency’s smallest unit, as you sent it."
    },
    "currency": {
      "type": "string",
      "enum": [
        "usd",
        "eur",
        "gbp",
        "chf",
        "pln",
        "czk",
        "huf",
        "ron",
        "dkk",
        "sek",
        "nok",
        "isk",
        "try",
        "jpy",
        "krw",
        "cny",
        "hkd",
        "sgd",
        "inr",
        "idr",
        "myr",
        "php",
        "thb",
        "ils",
        "aud",
        "nzd",
        "cad",
        "mxn",
        "brl",
        "zar",
        "uah",
        "ars",
        "clp",
        "aed",
        "sar",
        "twd",
        "vnd"
      ],
      "description": "The price’s currency, lower case. Every `amount_…` without `_usd` is in it."
    },
    "exchange_rate": {
      "oneOf": [
        {
          "$ref": "#/$defs/ExchangeRate"
        },
        {
          "type": "null"
        }
      ],
      "description": "null for usd; else what the price was turned into US dollars at when the session was made."
    },
    "amount_received": {
      "type": "string",
      "pattern": "^\\d+(\\.\\d+)?$",
      "description": "Received in all coins together, in the session’s currency: each transfer at the rate quoted when it was sent, then at `exchange_rate`. Money after completion still adds to it (`checkout.session.extra_received`); a reversed transfer no longer does. A decimal string."
    },
    "amount_due": {
      "type": "string",
      "pattern": "^\\d+(\\.\\d+)?$",
      "description": "The total asked, as a decimal in the session’s currency (\"24.90\", \"1500\" for yen). It does not go down as money arrives. A decimal string."
    },
    "amount_remaining": {
      "type": "string",
      "pattern": "^\\d+(\\.\\d+)?$",
      "description": "Still to send, in the session’s currency; zero once what arrived counts as paid (within the project’s underpayment tolerance). A decimal string."
    },
    "amount_due_usd": {
      "type": "string",
      "pattern": "^\\d+(\\.\\d+)?$",
      "description": "`amount_due` in US dollars: what every coin is counted against. A decimal string."
    },
    "amount_received_usd": {
      "type": "string",
      "pattern": "^\\d+(\\.\\d+)?$",
      "description": "`amount_received` in US dollars. A decimal string."
    },
    "amount_refunded": {
      "type": "integer",
      "minimum": 0,
      "description": "What you have recorded as sent back, in the currency’s smallest unit (see Refunds)."
    },
    "payment_methods": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "usdt_tron",
          "usdt_ethereum",
          "usdt_bsc",
          "usdt_solana",
          "usdt_ton",
          "usdt_polygon",
          "usdt_arbitrum",
          "usdt_optimism",
          "usdt_avalanche",
          "usdc_ethereum",
          "usdc_base",
          "usdc_solana",
          "usdc_polygon",
          "usdc_arbitrum",
          "usdc_optimism",
          "usdc_avalanche",
          "usdc_bsc",
          "usdc_stellar",
          "btc",
          "eth",
          "eth_base",
          "eth_arbitrum",
          "eth_optimism",
          "bnb",
          "sol",
          "ton",
          "trx",
          "pol",
          "avax",
          "ltc",
          "doge",
          "bch",
          "xrp",
          "xlm",
          "pyusd_ethereum",
          "pyusd_arbitrum",
          "dai_ethereum",
          "dai_arbitrum",
          "dai_optimism",
          "dai_polygon"
        ]
      },
      "description": "The ways to pay the session was made with; empty for every one the project takes."
    },
    "payment": {
      "oneOf": [
        {
          "$ref": "#/$defs/CheckoutSessionPayment"
        },
        {
          "type": "null"
        }
      ],
      "description": "What it is paid with: the coin most of the counted money came in, else the one the buyer picked last; null before any pick."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "The payment page to send the buyer to."
    },
    "success_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Where the page sends the buyer once paid, `{CHECKOUT_SESSION_ID}` replaced."
    },
    "cancel_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Where the page’s back link goes."
    },
    "client_reference_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Your order number."
    },
    "payment_link": {
      "type": [
        "string",
        "null"
      ],
      "description": "The payment link (`plink_…`) a buyer opened it from, or null for a session your server made."
    },
    "customer_email": {
      "type": [
        "string",
        "null"
      ],
      "format": "email",
      "description": "The buyer’s email: yours, or the one they gave on the page."
    },
    "customer_email_collection": {
      "type": "string",
      "enum": [
        "required",
        "optional",
        "off"
      ],
      "description": "Whether the page asks the buyer for an email before where to pay."
    },
    "locale": {
      "type": "string",
      "description": "The page’s language; `auto` is the buyer’s own."
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "description": "What is paid for, shown to the buyer."
    },
    "details": {
      "type": [
        "string",
        "null"
      ],
      "description": "What the buyer gets, shown under `description` on the payment page only."
    },
    "appearance": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "auto",
        "light",
        "dark",
        null
      ],
      "description": "The page’s light or dark; null: the project’s setting."
    },
    "metadata": {
      "$ref": "#/$defs/Metadata"
    },
    "paid_late": {
      "type": "boolean",
      "description": "The money came after the link expired."
    },
    "needs_review": {
      "type": "boolean",
      "description": "The payment is held for you to accept in the dashboard; the session then completes."
    },
    "review_reason": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "late",
        "amount",
        "refunded",
        "closed",
        "peg",
        "withdrawn",
        "handed_over",
        "reversed",
        "memo",
        null
      ],
      "description": "Why it was held, and stays once accepted; null when never held. `late` — the money came after expiry and the project reviews late payments; `amount` — far more came than was asked: it may be somebody else's payment; `refunded` — the merchant had refunded money of it before it was paid in full; `closed` — the merchant had closed the link by hand: the order may be cancelled; `peg` — the stablecoin it came in was trading away from the dollar; `withdrawn` — money came to an address a freeze withdrew: whoever froze the account may have put that wallet there, so it may not be the merchant's money at all; `handed_over` — the link was made before its account passed to whoever proved the email: we closed it then, and the money may be the earlier holder's customer's; `reversed` — money that had counted as final left the chain, and what is left no longer pays it, or it was held already; `memo` — the money came with a memo one slip off this payment's (a digit wrong, two swapped, one missing or one too many), for exactly its amount: most likely the buyer's, but only the merchant can say so."
    },
    "transactions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Transaction"
      },
      "description": "Every transfer seen, oldest first, and the first 20 worth less than a cent (`dust`)."
    },
    "dust_count": {
      "type": "integer",
      "minimum": 0,
      "description": "How many transfers worth less than a cent came, in all: never counted."
    },
    "created": {
      "type": "integer",
      "description": "When it was made. Unix seconds."
    },
    "expires_at": {
      "type": "integer",
      "description": "When the link runs out. Unix seconds."
    },
    "completed_at": {
      "type": [
        "integer",
        "null"
      ],
      "description": "When it completed. Unix seconds."
    },
    "closed_at": {
      "type": [
        "integer",
        "null"
      ],
      "description": "When you closed the link (expire); whatever arrives after is held for review. Unix seconds."
    }
  },
  "$defs": {
    "CheckoutSessionPayment": {
      "type": "object",
      "required": [
        "asset",
        "chain",
        "coin",
        "amount",
        "rate_usd",
        "amount_usd",
        "pay_address",
        "memo",
        "quote_expires_at"
      ],
      "properties": {
        "asset": {
          "type": "string",
          "enum": [
            "usdt_tron",
            "usdt_ethereum",
            "usdt_bsc",
            "usdt_solana",
            "usdt_ton",
            "usdt_polygon",
            "usdt_arbitrum",
            "usdt_optimism",
            "usdt_avalanche",
            "usdc_ethereum",
            "usdc_base",
            "usdc_solana",
            "usdc_polygon",
            "usdc_arbitrum",
            "usdc_optimism",
            "usdc_avalanche",
            "usdc_bsc",
            "usdc_stellar",
            "btc",
            "eth",
            "eth_base",
            "eth_arbitrum",
            "eth_optimism",
            "bnb",
            "sol",
            "ton",
            "trx",
            "pol",
            "avax",
            "ltc",
            "doge",
            "bch",
            "xrp",
            "xlm",
            "pyusd_ethereum",
            "pyusd_arbitrum",
            "dai_ethereum",
            "dai_arbitrum",
            "dai_optimism",
            "dai_polygon"
          ],
          "description": "The coin on its network, as in `payment_methods`."
        },
        "chain": {
          "type": "string",
          "enum": [
            "solana",
            "tron",
            "ethereum",
            "bsc",
            "base",
            "polygon",
            "arbitrum",
            "optimism",
            "avalanche",
            "ton",
            "bitcoin",
            "litecoin",
            "dogecoin",
            "bitcoincash",
            "xrp",
            "stellar"
          ]
        },
        "coin": {
          "type": [
            "string",
            "null"
          ],
          "description": "Its symbol, as USDT."
        },
        "amount": {
          "type": "string",
          "pattern": "^\\d+(\\.\\d+)?$",
          "description": "In the coin: what arrived, or what is asked while nothing has. A decimal string."
        },
        "rate_usd": {
          "type": "string",
          "pattern": "^\\d+(\\.\\d+)?$",
          "description": "The coin’s US dollar rate quoted; \"1\" for a stablecoin. A decimal string."
        },
        "amount_usd": {
          "type": "string",
          "pattern": "^\\d+(\\.\\d+)?$",
          "description": "What arrived in it, in US dollars. A decimal string."
        },
        "pay_address": {
          "type": [
            "string",
            "null"
          ],
          "description": "Where the buyer pays; null for an address a freeze withdrew."
        },
        "memo": {
          "type": [
            "string",
            "null"
          ],
          "description": "The memo, tag or comment the payment must carry, on networks that use one."
        },
        "quote_expires_at": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Until when the quoted rate holds. Unix seconds."
        }
      }
    },
    "ExchangeRate": {
      "type": "object",
      "description": "What a price was turned into US dollars at.",
      "required": [
        "usd",
        "date",
        "source"
      ],
      "properties": {
        "usd": {
          "type": "string",
          "pattern": "^\\d+(\\.\\d+)?$",
          "description": "US dollars for one unit of the currency. A decimal string."
        },
        "date": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "The day of that rate."
        },
        "source": {
          "type": "string",
          "enum": [
            "ecb",
            "coingecko"
          ],
          "description": "`ecb`: the European Central Bank’s reference rate; `coingecko`: the market’s, for a currency the ECB does not publish."
        }
      }
    },
    "Metadata": {
      "type": "object",
      "description": "Up to 50 string values of your own, returned as given: keys up to 40 characters, values up to 500, 8 KB in all as JSON (a character outside ASCII counts as 6 bytes).",
      "maxProperties": 50,
      "propertyNames": {
        "maxLength": 40
      },
      "additionalProperties": {
        "type": [
          "string",
          "null"
        ],
        "maxLength": 500
      }
    },
    "Transaction": {
      "type": "object",
      "description": "One transfer to the payment’s address, as the chain reports it.",
      "required": [
        "signature",
        "asset",
        "amount",
        "amount_usd",
        "amount_coin",
        "rate_usd",
        "status",
        "confirmations",
        "dust",
        "delivery",
        "from",
        "block_time",
        "explorer_url"
      ],
      "properties": {
        "signature": {
          "type": "string",
          "description": "The transaction’s hash (a signature on Solana); `sim_…` for one made by the simulator."
        },
        "asset": {
          "type": [
            "string",
            "null"
          ],
          "description": "The coin on its network, as in `payment_methods`."
        },
        "amount": {
          "type": "string",
          "pattern": "^\\d+(\\.\\d+)?$",
          "description": "What it counted for, in the session’s currency. A decimal string."
        },
        "amount_usd": {
          "type": "string",
          "pattern": "^\\d+(\\.\\d+)?$",
          "description": "The same in US dollars. A decimal string."
        },
        "amount_coin": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^\\d+(\\.\\d+)?$",
          "description": "In the coin, with its own decimals."
        },
        "rate_usd": {
          "type": [
            "string",
            "null"
          ],
          "description": "The coin’s US dollar rate it was counted at."
        },
        "status": {
          "type": "string",
          "enum": [
            "confirmed",
            "finalized",
            "reversed"
          ],
          "description": "`confirmed` — seen, not final yet; `finalized` — final, it counts; `reversed` — it left the chain after it had counted and no longer counts."
        },
        "confirmations": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Blocks since it, as last read."
        },
        "dust": {
          "type": "boolean",
          "description": "Worth less than a cent: on record, in no sum."
        },
        "delivery": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "waiting",
            "held",
            "sending",
            "delivered",
            "left",
            null
          ],
          "description": "On Ethereum, its relatives and TRON, where the money is: `waiting` — not final yet; `held` — final, at the payment’s own address; `sending` — a withdrawal is on its way; `delivered` — in your wallet; `left` — withdrawn to the wallet the payment was quoted for, which is no longer the project’s. null on networks that pay your wallet directly."
        },
        "from": {
          "type": [
            "string",
            "null"
          ],
          "description": "The address it came from. Never a refund address."
        },
        "block_time": {
          "type": [
            "integer",
            "null"
          ],
          "description": "The time of its block; null while unconfirmed. Unix seconds."
        },
        "explorer_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "The transaction on the network’s explorer; null for a simulated one."
        }
      }
    }
  }
}