Start payment for an online payment method
Changed onCall 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.
Request
- Base URLhttp://localhost:8000/api/shop
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
Storefront API Key for authentication. Required for all shop/storefront API requests.
Locale code for localized data (e.g. "en", "fr", "ar"). Defaults to channel's default locale.
Channel code (e.g. "default"). Defaults to the current channel.
Currency code (e.g. "USD", "EUR", "INR"). Defaults to channel's base currency.
Response
What the client needs to start the payment.
Changes
- info
endpoint added
- info