Skip to content
API referenceAPI v1admin-sdk 1.1.52Search docs⌘K
Checkout sessions · Create a session
API reference / Checkout sessions

Create a session

POST/api/v1/checkout/sessionsno app scope

Starts a hosted checkout: Inkress prices the cart, runs the fraud check and returns the page to show. The order is made only when the payment succeeds.

A session needs the customer's browser. For a server-to-server flow, create an order or a payment link.

Body

totalnumber

Amount in the major unit. Leave out when products set it.

customerobjectrequired

Who is paying. Matched to an existing customer by email.

emailstringrequired

Receipts go here.

first_namestringrequired

First name.

last_namestringrequired

Last name.

phonestring

With country code.

currency_codestring

JMD or USD.

reference_idstring

Your own ID. Made for you if you leave it out.

titlestring

Shown on the payment page.

productsarray

Items with id and quantity.

discount_codestring

Checked when the session is made; an invalid code refuses the session.

Headers

Authorizationheaderrequired

Bearer with your secret key, or the merchant's OAuth token.

Returns

The session: session_id, status pending, totals (sub_total, customer_total, fees, shipping, tax, discount), frame_url for the payment page and expires.

statusMeaning
pendingCreated.
awaiting_paymentThe customer is paying.
payment_pendingThe bank hasn't answered yet.
completedPaid; order_id is set.
payment_failedDeclined.
payment_cancelledThe customer backed out.
cancelledYou cancelled it.
expiredTimed out.

Errors

402payment_declined: the fraud check declined it (data.outcome says why), or merchant_unavailable: the merchant can't take payments.
422A customer field is missing (Customer email is required), a product is unknown or out of stock, or the discount code doesn't apply.