Payment Links and Sessions
Opening an API-created Session URL reuses that checkout. Card Payment Links keep their existing payment page and return settings.
Create a Session
CallPOST /v1/checkout-sessions from your server with X-API-Key and an Idempotency-Key. This example uses the default card payment method and an inline product and price:
201 with a ready-to-use url. Selected response fields:
url. Use it exactly as returned; do not reconstruct the address or embed your API key. Keep the returned id with your purchase record.
See Create a checkout session for the complete request and response schema.
Choose purchase details
Catalog products have a product ID and can be reused across purchases. Inline products are supplied for a specific purchase and saved with the Session without creating a separate catalog product. Choose an existing price or supply a price for this purchase:- Existing price: provide the top-level
pricingId. The price already identifies its product, amount, and currency; you do not provide a separate product ID. - Price for this purchase: provide the top-level
pricingData, including the amount and currency. Inside it, useproductIdto reference an existing product, orproductDatato supply inline product details.
pricingId and pricingData are mutually exclusive. productId is nested inside pricingData, not a top-level alternative to pricingId.
Inside
pricingData, choose exactly one of productId and productData. Inline details are saved with the Session and can be read from its detail response; they do not create separately browsable catalog products or prices. The Session keeps a purchase snapshot so later catalog edits do not change its quoted purchase.
If you use product access checks, choose pricingId or pricingData.productId: both retain a catalog product ID, including when the price is supplied for this purchase. Purchases using pricingData.productData have no catalog product ID and are not included in entitlement checks, even after successful payment or subscription activation.
For inline products, manage access in your own system using verified order/subscription status and your server-side purchase records. A product name is a display label, not an entitlement identifier; a completed Checkout Session does not establish that a subscription is still active.
amount is the unit price in the currency’s smallest unit; the Session purchase amount includes quantity, which defaults to 1. For USD, 3500 means $35.00. For USDC and USDT, 1000000 means one token. Customer information is optional when creating a Session. You may omit both customerId and customerEmail; if you provide customer information, send only one of them. Card checkout also supports subscription pricing; use the billing fields in the generated schema.
For crypto, use provider: "CRYPTO" and a supported USDC or USDT price. Configure the organization’s receiving wallet first. The hosted checkout provides the configured network and receiver; customers should follow the network shown there. Crypto API Sessions currently support one-time pricing.
Input limits
Idempotency and retries
- Generate one
Idempotency-Keyfor each creation request. Retry the same request with the same key and unchanged parameters after a timeout or503. - Reusing a key with different parameters returns
409. A retry whose existing checkout can no longer be paid can also return409; use a new key for an intentional new checkout. merchantReferenceis a business correlation value, not an idempotency key or a uniqueness lock. Different creation keys can create separate Sessions for the same reference.- Invalid input returns
400. Failed creation does not return a usable payment URL. - Creation returns
403if the organization is frozen, Card/USD verification is incomplete, or the card payment account is missing or not enabled to receive payments. Complete the relevant setup before retrying.
metadata as a map of strings. It is returned with the Session and carried to the order as merchantMetadata; merchantReference remains a separate field.
Query and confirm payment
UseGET /v1/checkout-sessions/{id} to retrieve the Session in your organization:
COMPLETE does not guarantee that funds have arrived: an asynchronous payment can still be pending. A fully refunded order can have orderStatus: "REFUNDED" while its Session remains COMPLETE; a refund does not reopen checkout. Partial refunds may leave the order PAID, so use order details for refund information.
Confirm payment through the Orders API or a verified order webhook, not a browser return or the Session lifecycle alone. Orders associated with a Session include checkoutSessionId. Fulfill idempotently by order ID. Subscription renewals are separate orders linked to the subscription and initial order; they do not complete the initial Session again.
The Session URL covers both payment and the resulting receipt. Reopening a receipt does not create a new purchase.
Expiry and return URLs
expiresIn is in seconds and defaults to 3600. Card checkout accepts 1800–86400; crypto accepts 60–86400. To stop an unpaid checkout, call POST /v1/checkout-sessions/{id}/expire:
EXPIRED; expiring an already EXPIRED Session also succeeds. Sessions in COMPLETE or FAILED return 409. If expiration fails, query the Session before assuming it is closed. For crypto, expiry closes the payment entry but cannot revoke a receiving address or undo a transfer already sent.
successUrl and cancelUrl must be absolute HTTPS URLs. Payment success can return the buyer to your configured URL with the signed result; leaving via the cancel link does not by itself cancel or fail the Session. Always confirm the order on your server.
Find Sessions in Business
Open Business → Sales → Checkout Sessions. The list defaults to API-created Sessions. Use Source to select API sessions, Payment Link sessions, or All sources. Search using the full Session ID or merchant reference, and open a row to inspect purchase details and the related order. A payable Session offers Open checkout.Create
Create a checkout for a purchase.
Retrieve
Read its lifecycle and order relationship.
Expire
Stop an unpaid checkout.