Checkout
Storefront Checkout API endpoints
An API call to make a purchase.
Path parameters
cart_idRequiredstringCart ID
Query parameters
expandoptionalstring[]Expandable relations, prefixed with subscription., invoice. or orders. (e.g. invoice.billing_address, subscription.payment_method, orders.items.product).
Request body
payment_intent_idoptionalstring | nullA payment intent of the customer, after a 402. Not together with payment_method_id.
payment_method_idoptionalinteger | nullA payment method of the customer that supports the cart's currency. Not together with payment_intent_id.
ReturnsPurchase
Purchase object response
Error responses
400objectA guest cart's email is already registered (user_email_is_not_unique); the signed-in customer is not the cart's customer, or no customer is signed in and the cart has no guest details (unauthorized_customer); the cart is not active (it is completed or expired) or belongs to another shop (bad_request); the cart has no available items (cart_empty); a bundle item carries invalid preferences (bundle_preferences_not_valid) or invalid products (bundle_items_not_valid); a subscription item carries invalid survey answers (invalid_survey); the payment_intent_id payment is not confirmed or does not match the invoice's amount and currency (payment_intent_not_valid, "This payment is invalid."); the cart's coupon stopped being redeemable while the purchase ran (coupon_not_redeemable, "The coupon can no longer be redeemed."); or a concurrent purchase redeemed the cart's gift card first (gift_card_already_redeemed, "The gift voucher was already redeemed.").
402objectThe payment did not complete: the card was declined (card_error), it needs customer authentication such as 3D Secure (payment_requires_action), or it is otherwise incomplete (incomplete_payment). Retry with the returned payment_intent_id.
404objectNo cart with this ID exists.
422objectpayment_intent_id is not a payment intent of the customer, payment_method_id is not a payment method of the customer or cannot be charged in the cart's currency ("The payment method id is invalid"), both are sent, or expand is not an array. The cart checks of POST /cart/{cart_id}/validate also answer here, with the same field errors.
429objectAnother rate-limited request from the same customer (or from the same IP when no customer token is sent) is still in progress.