Skip to main content

CreateCheckoutSessionRequest

amountinteger<int64>

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

currencyCurrencyCode

Possible values: Value must match regular expression ^[A-Z]{3}$

Examples:
Example: USD
merchantIdstring
locationIdstring
descriptionstringnullable
successUrlstring<uri>
cancelUrlstring<uri>
webhookUrlstring<uri>nullable
lineItems object[]
  • Array [
  • namestring
    descriptionstringnullable
    quantityinteger

    Possible values: >= 1

    unitPriceinteger<int64>

    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

    priceIdstringnullable

    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.

    taxablebooleannullable

    Defaults to true for custom lines; a catalog product's explicit tax treatment cannot be overridden.

    categoryCodestringnullable

    Tax-provider category code matched against configured category tax rules, not a merchandising category ID.

    Possible values: non-empty and <= 255 characters

    taxAmountinteger<int64>nullable

    Required on every PRECOMPUTED line, including zero-tax lines; exact line tax, not per-unit tax. Forbidden in AUTOMATIC mode.

    Possible values: >= 0

  • ]
  • taxModeCheckoutTaxMode

    Possible values: [AUTOMATIC, PRECOMPUTED]

    Default value: AUTOMATIC
    totalTaxinteger<int64>nullable

    Required 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

    customerEmailstring<email>nullable
    metadata objectnullable
    property name*anynullable
    expiresInintegernullable

    Possible values: >= 60

    allowedPaymentMethodsstring[]nullable
    captureMethodstringnullable
    saveCardbooleannullable

    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
    planNamestringrequired
    intervalstringrequired
    intervalCountintegernullable
    startDatestringrequired
    endDatestringnullable
    maxCyclesintegernullable
    webhookUrlstringnullable
    metadata objectnullable
    property name*string
    shippingAddressCollection object
    enabledboolean
    allowedCountriesstring[]
    shippingOptions object[]
  • Array [
  • idstringrequired
    namestringrequired
    amountintegerrequired

    Possible values: >= 0

    estimatedDaysMinintegernullable
    estimatedDaysMaxintegernullable
  • ]
  • promotionCodestringnullable
    promotionCodesstring[]nullable
    CreateCheckoutSessionRequest
    {
    "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,
    "customerEmail": "[email protected]",
    "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"
    ]
    }