Skip to main content
POST
Create a checkout
Webhook: none. checkout.session.completed fires later, when AgentaOS confirms the buyer’s payment. See Which action fires which event.
Send paymentMethods: ["card"] to make the checkout card-only. Without it, an EUR checkout also offers bank transfer. An impossible list (empty, no card, or bank transfer outside EUR) answers 400 with code: "payment_methods_unavailable". Without buyerEmail, the checkout page asks the buyer for their email.
The REST path is /gateway/sessions (the underlying resource is called a “session”); the TypeScript SDK and the CLI both call it a checkout (agentaos.checkouts, agenta pay checkout).
The create and list responses do not include a plain amount, only amount_override (null unless you passed one). For a link-based checkout, the effective price is the link’s amount. To get a single, ready-to-display price, call Retrieve a checkout, which computes amount for you.

Authorizations

x-api-key
string
header
required

Your secret key, from app.agentaos.ai -> Settings -> Developers -> API Keys. The key's prefix is both its identity and its environment: sk_test_... (sandbox, free, no verification) or sk_live_... (real money, requires business verification). A missing or invalid key returns 401.

Headers

Idempotency-Key
string

Alternative to the body's idempotencyKey field. The header wins if both are sent.

Body

application/json

Either linkId or amount is required (amount is required when creating a standalone checkout with no link).

Payment link UUID to create from. Inherits amount, currency, description, taxRateId, and the seller mode. Omit for a standalone checkout.

amount
number

Required if no linkId.

Required range: 0.01 <= x <= 1000000
amountOverride
number

With linkId, overrides the link's amount for this checkout only.

Required range: 0.01 <= x <= 1000000
currency
enum<string>

Ignored (inherited from the link) when linkId is set.

Available options:
EUR,
USD,
EURC,
EURe,
USDC
description
string
Maximum string length: 1000
taxRateId
string<uuid>
dueDate
string<date>

YYYY-MM-DD. Presentation only, stamped onto the invoice issued for this checkout.

buyerEmail
string<email>
Maximum string length: 320
buyerName
string
Maximum string length: 200
buyerCompany
string
Maximum string length: 200
buyerCountry
string

ISO 3166-1 alpha-2, e.g. DE. Drives destination-VAT calculation.

Maximum string length: 2
buyerAddress
string
Maximum string length: 500
buyerVat
string
Maximum string length: 20
webhookUrl
string<uri>
Maximum string length: 2048
successUrl
string<uri>
Maximum string length: 2048
cancelUrl
string<uri>
Maximum string length: 2048
expiresIn
integer

Seconds until the checkout expires. Without it: 24 hours for a card checkout, 48 hours for an EUR checkout that offers bank transfer, 30 minutes for a stablecoin checkout. At the deadline a card payment not yet completed is stopped; a bank transfer the buyer chose before it stays valid up to 30 days.

Required range: 300 <= x <= 86400
paymentMethods
enum<string>[]

What the checkout offers. ["card"] makes it card-only. Without it: card, plus bank transfer on EUR. Card must be included; bank transfer is EUR only. An impossible list answers 400 payment_methods_unavailable.

Available options:
card,
bank_transfer
metadata
object

Up to 8KB serialized.

supportedNetworks
string[]

CAIP-2 network IDs. Defaults to Base mainnet for crypto-settlement checkouts.

idempotencyKey
string

Also settable via the Idempotency-Key request header (the header wins if both are sent).

Response

Checkout created.

id
string<uuid>
required

Internal checkout UUID.

org_id
string<uuid>
required
session_id
string
required

Public ID, used in the checkout URL and as the path parameter for every other call on this resource.

idempotency_key
string | null
required
amount_override
number | null
required

Set only if you passed amount or amountOverride at create.

currency
string
required
metadata
object
required
webhook_url
string | null
required
success_url
string | null
required
cancel_url
string | null
required
tax_rate_id
string<uuid> | null
required
supported_networks
string[]
required
expires_at
string<date-time>
required
status
enum<string>
required
Available options:
open,
completed,
expired,
cancelled
created_at
string<date-time>
required
updated_at
string<date-time>
required
seller_mode
enum<string>
required
Available options:
mor,
crypto
environment
enum<string>
required
Available options:
test,
live
checkoutUrl
string
required

Send your buyer here. Computed, camelCase.

invoiceId
string<uuid> | null

The invoice issued with this checkout. Only in the response to POST /gateway/sessions, and absent when no invoice was issued.

invoiceNumber
string | null

That invoice's number. Only in the response to POST /gateway/sessions, and absent when no invoice was issued.

x402Url
string

Agent-to-agent payment URL via the x402 protocol. Computed, camelCase. Most integrations can ignore it.

description
string | null

The checkout's own line text, when it was created with one. Otherwise the product's description applies.

sepa_reference
string | null

The reference the buyer puts on a bank transfer to this checkout. Null until a bank transfer is chosen.

List only (GET /gateway/sessions): the product's amount, currency and description. Null for a checkout with no product.