Checkout

Start payment for an online payment method

Changed on

Call this instead of placing the order when the selected payment method is an online gateway (the place-order response then has redirect: true). Uses the cart of the Bearer token; addresses, shipping and payment method must already be saved. The response says how to hand the customer to the gateway: redirect (open redirectUrl: Stripe, PhonePe, PayGlocal), form (POST formFields to formAction: PayPal Standard, PayU) or sdk (open the gateway SDK with sdkData: Razorpay, PayPal Smart Button). PayPal Smart Button returns the PayPal order_id to hand to the PayPal JS SDK createOrder callback, with the client_id and currency to load the SDK with. Stripe, PhonePe, PayGlocal and PayU create the order on their own return. For Razorpay, PayPal Standard and PayPal Smart Button, call POST /api/shop/checkout-payments/confirm after payment.

post/checkout-payments/initiate

Request

Headers

X-STOREFRONT-KEYstring required

Storefront API Key for authentication. Required for all shop/storefront API requests.

X-Localestring
Example:en

Locale code for localized data (e.g. "en", "fr", "ar"). Defaults to channel's default locale.

X-Channelstring
Example:default

Channel code (e.g. "default"). Defaults to the current channel.

X-Currencystring
Example:USD

Currency code (e.g. "USD", "EUR", "INR"). Defaults to channel's base currency.

Response

What the client needs to start the payment.

Changes