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

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

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

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

Example:

"US"

user_agent
string

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

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

Example:

64496

email
string

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

Internal: link the customer's Discord account.

Example:

null

discord_user_username
string

Internal: link the customer's Discord account.

Example:

null

discord_access_token
string

Internal: link the customer's Discord account.

Example:

null

discord_refresh_token
string

Internal: link the customer's Discord account.

Example:

null

coupon
string

A coupon code to apply.

Example:

"SAVE10"

gateway
string

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, ADYEN, SHOPIFY, AMAZONPS, PAYCEK, PAYPAL, PAYPALFF, CASHAPP, VENMO, ZELLE, SKRILLP2P, REWARBLE, BTC, LTC. CUSTOMERBALANCE is not allowed on this endpoint.

Example:

"STRIPE"

payment_method_id
integer

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

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

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

Example:

"PARTNER10"

billing_name
string

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

Example:

"John Doe"

billing_address_line1
string

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

Example:

"123 Main St"

billing_address_line2
string

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

Example:

"Apt 4"

billing_city
string

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

Example:

"Springfield"

billing_state
string

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

Example:

"IL"

billing_postcode
string

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

Example:

"62701"

billing_country
string

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

Example:

"US"

shipping_name
string

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

Example:

"John Doe"

shipping_address_line1
string

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

Example:

"123 Main St"

shipping_address_line2
string

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

Example:

"Apt 4"

shipping_city
string

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

Example:

"Springfield"

shipping_state
string

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

Example:

"IL"

shipping_postcode
string

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

Example:

"62701"

shipping_country
string

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

Example:

"US"

shipping_phone
string

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

Example:

"+1 555 0100"

metadata
string[]

Must not be greater than 255 characters.

Example:
attribution
object

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

Without a preselected payment method: url opens the hosted checkout

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://demo-shop.sellauth.com/checkout/98b3f45d848c5-0000000000003"