Skip to main content

The CheckoutSession object

Represents a checkout session for payment processing. Checkout sessions are created to initiate a payment flow and can be used for hosted checkout pages or embedded payment experiences.

Fields

FieldTypeDescription
id
REQUIRED
stringUnique identifier for the checkout session
merchantId
REQUIRED
stringID of the merchant who created the session
playerId
REQUIRED
stringID of the player/user making the payment
amount
REQUIRED
numberPayment amount in the source currency
targetSettlementAsset
REQUIRED
stringTarget cryptocurrency for settlement (e.g., 'USDC')
status
REQUIRED
'created'| 'active'| 'completed'| 'cancelled'| 'expired'Current status of the checkout session
paymentIntentId
OPTIONAL
stringAssociated payment intent ID (if payment initiated)
rampOrderId
OPTIONAL
stringAssociated ramp order ID (if on-ramp initiated)
successUrl
OPTIONAL
stringURL to redirect on successful payment
cancelUrl
OPTIONAL
stringURL to redirect on cancelled payment
paymentPageUrl
OPTIONAL
stringURL to the hosted payment page
expiresAt
OPTIONAL
stringISO 8601 timestamp when the session expires
createdAt
REQUIRED
stringISO 8601 timestamp when the session was created
updatedAt
REQUIRED
stringISO 8601 timestamp when the session was last updated

Example

{
"id": "obj_1a2b3c",
"merchantId": "merchant_1a2b3c",
"playerId": "player_1a2b3c",
"amount": 5000,
"targetSettlementAsset": "string",
"status": "created",
"paymentIntentId": "paymentintent_1a2b3c",
"rampOrderId": "ramporder_1a2b3c",
"createdAt": "2026-01-15T09:30:00Z",
"updatedAt": "2026-01-15T09:30:00Z"
}

Usage

const session = await client.checkout.create({
playerId: 'player_123',
amount: 100,
targetSettlementAsset: 'USDC',
successUrl: 'https://myapp.com/success'
});
// Redirect user to session.paymentPageUrl