CreateCheckoutSessionRequest
Base amount in integer minor currency units. Required when lineItems is empty. When lineItems are sent, omit amount to use their subtotal (sum of quantity times charged unit price), or send exactly that subtotal; any other value returns 400. Discounts, shipping, and tax may change the final payable amountTotal.
Possible values: >= 1
Possible values: Value must match regular expression ^[A-Z]{3}$
- Example 1
- Example 2
- Example 3
USDEURGBPlineItems object[]
Possible values: >= 1
Unit price in integer minor currency units for a custom line (with name) that has no priceId. Sending unitPrice together with priceId returns 400; catalog lines are charged at the catalog price.
Possible values: >= 0
Catalog price identifier. The line is charged and stored at this price's unit amount; do not also send unitPrice. Its currency must match the session. The product's non-null taxRateBps is authoritative (zero means exempt, null inherits scoped/category rules). Tax-inclusive catalog prices are rejected rather than taxed twice; use custom net lines in PRECOMPUTED mode or an amount-only gross receivable.
Defaults to true for custom lines; a catalog product's explicit tax treatment cannot be overridden.
Tax-provider category code matched against configured category tax rules, not a merchandising category ID.
Possible values: non-empty and <= 255 characters
Required on every PRECOMPUTED line, including zero-tax lines; exact line tax, not per-unit tax. Forbidden in AUTOMATIC mode.
Possible values: >= 0
Possible values: [AUTOMATIC, PRECOMPUTED]
AUTOMATICRequired only in PRECOMPUTED mode; must exactly equal the sum of line taxAmount values. Base amount excludes this additional tax. Exempt or zero-value lines must have zero tax. PRECOMPUTED quantities/promotions cannot change: create a replacement session with authoritative taxes. Amount-only gross receivable collection may explicitly supply zero additional tax; this is not a claim that the underlying sale was exempt.
Possible values: >= 0
metadata objectnullable
Possible values: >= 60
Offers the signed-in customer an explicit, unchecked-by-default option to save the new card entered on this checkout. The card is saved (a customer-initiated card-on-file enrollment whose saved payment method is returned as paymentMethodId) only when that customer opts in with saveCard on pay. Guests, and customers who do not opt in, get an ordinary sale. A zero-dollar payment cannot save a card.
createSubscription object
metadata objectnullable
shippingAddressCollection object
shippingOptions object[]
Possible values: >= 0
{
"amount": 0,
"currency": "USD",
"merchantId": "string",
"locationId": "string",
"description": "string",
"successUrl": "string",
"cancelUrl": "string",
"webhookUrl": "string",
"lineItems": [
{
"name": "string",
"description": "string",
"quantity": 0,
"unitPrice": 0,
"priceId": "string",
"taxable": true,
"categoryCode": "string",
"taxAmount": 0
}
],
"taxMode": "AUTOMATIC",
"totalTax": 0,
"metadata": {},
"expiresIn": 0,
"allowedPaymentMethods": [
"string"
],
"captureMethod": "string",
"saveCard": true,
"createSubscription": {
"planName": "string",
"interval": "string",
"intervalCount": 0,
"startDate": "string",
"endDate": "string",
"maxCycles": 0,
"webhookUrl": "string",
"metadata": {}
},
"shippingAddressCollection": {
"enabled": true,
"allowedCountries": [
"string"
]
},
"shippingOptions": [
{
"id": "string",
"name": "string",
"amount": 0,
"estimatedDaysMin": 0,
"estimatedDaysMax": 0
}
],
"promotionCode": "string",
"promotionCodes": [
"string"
]
}