Checkout

Create a checkout session

post

Creates a checkout session from a secure server using an API Key. If you have a Customer token, see the Storefront API Create Checkout endpoint.

Authorizations
AuthorizationstringRequired

An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.

Path parameters
storeIdstringRequired
Body

Request to create a new checkout session from your back-end server using the management API. customer_id needs to be specified explicitly here instead of using a Customer token.

subscriptionnull | booleanOptionalDeprecated

Whether this checkout creates a subscription. DEPRECATED: Use 'subscription' field in 'lines' array objects instead.

coupon_idstring · flake-idOptionalExample: 411486491630370816
affiliate_codenull | stringOptional

Optional affiliate code to track referrals

return_urlnull | stringOptional

Optional URL to redirect to after successful checkout

cancel_urlnull | stringOptional

Optional URL to redirect to if checkout is canceled

auto_redirectnull | booleanOptional

Whether to automatically redirect the customer (return_url must be set)

metadatanull | objectOptional

Optional metadata to associate with the checkout session. Do not store any sensitive information here.

customer_idstring · flake-idRequiredExample: 411486491630370816
Responses
200

OK

application/json
post
/v1/stores/{storeId}/checkouts

Last updated

Was this helpful?