Skip to main content
POST
Create Checkout Session

Authorizations

Authorization
string
header
required

You can retrieve your API key from your dashboard under Account > Developers.

Path Parameters

shopId
integer
required

The shop ID.

Body

application/json
cart
object[]
required

The cart items. Each item is either a catalog item (productId + variantId) or a custom item (name + price). Both kinds can be mixed in one cart.

Example:
currency
string | null

ISO 4217 currency code. Required when every cart item is a custom item; otherwise inferred from the products. Must be 3 characters.

Example:

"USD"

ip
string | null

The end buyer's IP address. Defaults to the caller's IP; forward the buyer's IP when calling from your backend so fraud checks and analytics see the real buyer. Must be a valid IP address.

Example:

"203.0.113.10"

country_code
string | null

The end buyer's ISO 3166-1 alpha-2 country code. Must contain only letters. Must be 2 characters.

Example:

"US"

user_agent
string | null

The end buyer's user agent. Defaults to the caller's user agent.

Example:

"Mozilla/5.0 (Windows NT 10.0; Win64; x64)"

asn
integer | null

The end buyer's autonomous system number, if you have it.

Example:

64496

email
string | null

Prefill the customer email. When both email and a payment method are provided, the invoice is created as pending and a payment session is started immediately.

Example:

"customer@example.com"

discord_user_id
string | null

Internal: link the customer's Discord account.

Example:

null

discord_user_username
string | null

Internal: link the customer's Discord account.

Example:

null

discord_access_token
string | null

Internal: link the customer's Discord account.

Example:

null

discord_refresh_token
string | null

Internal: link the customer's Discord account.

Example:

null

coupon
string | null

A coupon code to apply.

Example:

"SAVE10"

gateway
string | null

DEPRECATED, use payment_method_id. The payment gateway type to preselect. One of STRIPE, SQUARE, SUMUP, MOLLIE, SKRILL, AUTHORIZENET, REVOLUTBUSINESS, LEMONSQUEEZY, NMI, OVERPAY, MONEI, RAZORPAY, PANDABASE, VENPAYR, OVGC, DODOPAYMENTS, PAYMONGO, PLATEGA, SKINLOOP, SHOPIFY, AMAZONPS, PAYCEK, PAYPAL, PAYPALFF, CASHAPP, VENMO, ZELLE, SKRILLP2P, WISEP2P, REWARBLE, BTC, LTC. CUSTOMERBALANCE is not allowed on this endpoint.

Example:

"STRIPE"

payment_method_id
integer | null

The payment method to preselect. Shown in the URL when editing a payment method in the dashboard. When set together with email, a payment session is started immediately and the response url points to the payment page.

Example:

1

newsletter
boolean | null

Subscribe the customer to the shop newsletter. Only send true if the customer actually consented; false or omitted leaves their current subscription untouched, and a customer who unsubscribed themselves stays unsubscribed.

Example:

false

affiliate
string | null

An affiliate code to credit for this sale. Must not be greater than 16 characters.

Example:

"PARTNER10"

billing_name
string | null

Prefill: billing name. Must not be greater than 100 characters.

Example:

"John Doe"

billing_address_line1
string | null

Prefill: billing address line 1. Must not be greater than 150 characters.

Example:

"123 Main St"

billing_address_line2
string | null

Prefill: billing address line 2. Must not be greater than 150 characters.

Example:

"Apt 4"

billing_city
string | null

Prefill: billing city. Must not be greater than 100 characters.

Example:

"Springfield"

billing_state
string | null

Prefill: billing state or region. Must not be greater than 100 characters.

Example:

"IL"

billing_postcode
string | null

Prefill: billing postcode. Must not be greater than 20 characters.

Example:

"62701"

billing_country
string | null

Prefill: billing country (ISO 3166-1 alpha-2). Must be 2 characters.

Example:

"US"

shipping_name
string | null

Prefill: shipping name. Must not be greater than 100 characters.

Example:

"John Doe"

shipping_address_line1
string | null

Prefill: shipping address line 1. Must not be greater than 150 characters.

Example:

"123 Main St"

shipping_address_line2
string | null

Prefill: shipping address line 2. Must not be greater than 150 characters.

Example:

"Apt 4"

shipping_city
string | null

Prefill: shipping city. Must not be greater than 100 characters.

Example:

"Springfield"

shipping_state
string | null

Prefill: shipping state or region. Must not be greater than 100 characters.

Example:

"IL"

shipping_postcode
string | null

Prefill: shipping postcode. Must not be greater than 20 characters.

Example:

"62701"

shipping_country
string | null

Prefill: shipping country (ISO 3166-1 alpha-2). Must be 2 characters.

Example:

"US"

shipping_phone
string | null

Prefill: shipping phone number. Must not be greater than 20 characters.

Example:

"+1 555 0100"

metadata
(string | null)[]

Must not be greater than 255 characters.

Example:
attribution
object | null

Your server's view of how the buyer arrived: utm_source, utm_medium, utm_campaign, utm_term, utm_content, referrer_host (host only). Each max 100 chars; stored on the invoice for filtering and reporting.

Example:

Response

With email + payment method: url points to the payment provider

success
boolean
Example:

true

invoice_id
integer
Example:

3

invoice_url
string
Example:

"https://demo-shop.sellauth.com/checkout/98b3f45d848c5-0000000000003"

url
string
Example:

"https://checkout.stripe.com/c/pay/cs_test_a139AH1zApQWCLRABDj7fBVDZ0puTeWxKQMeOENUVAv0NzDmBVbCwSKYTX"