Skip to main content

POST /checkout

Create a checkout session from the current cart. The cart is validated and cleared upon successful checkout creation.

Authentication

Requires Bearer token (auth:customer_api) and X-Cart-Token.

Headers

Body Parameters

Example Request

Response

Payment Required (200)

When the order total is greater than zero, a payment URL is returned:
Redirect the customer to redirect_url to complete the payment.

Free Order (200)

When the order total is zero (e.g., 100% discount coupon), the order is created immediately:

Error Responses

The cart is cleared after a successful checkout. If the customer needs to modify their order, they must add items to the cart again.
The checkout includes a server-side total recalculation as a security measure. If the cart total doesn’t match the recalculated amount (e.g., due to cart manipulation), the checkout will fail.

GET /checkout//result

Get the result of a checkout after payment processing. Use the checkout_url value (not the numeric ID) as the path parameter.

Authentication

Requires Bearer token (auth:customer_api).

Path Parameters

Headers

Example Request

Response

Success (200)

Error Responses

Poll this endpoint after redirecting the customer back from the payment page to check whether the payment was successful and the order was created.