Authorization and x-partner-id headers with x-api-key and x-external-user-id.
Send x-idempotency-key when creating an order or initiating a payment, and reuse a key only to retry the same request.
- Orders: the same key with the same order returns the original order instead of creating a second one. The same key with different items, address, alternate phone, coupon, payment mode, delivery method or balance options returns
409Checkout idempotency key has already been used with a different payload.paymentReturnUrlis not compared. - Payments: while a payment session is active, initiating again returns that same session, whatever the key or body. Once the attempt has ended (for example after abandon), reusing its key returns
409Payment attempt idempotency key has already been used, so send a new key for each new attempt.
Check shipping serviceability
Check delivery methods and payment options for a cart before checkout.express.available reports courier coverage only. Offer express delivery only when the delivery quote also returns expressDeliveryEnabled: true; otherwise express requests return 400 Express delivery is not available.
Request:
productVariantId for products with variants. items accepts up to 100 entries.
Get delivery quote
Query parameters:
Request:
Check COD eligibility
Send the cart items to check COD eligibility with the same pricing that checkout uses, including coupons, Reward Points, Wallet Cash, and delivery charges.
Request:
totalCollectableAmount is the amount the customer pays on delivery, including codCharge.
Requests without
items must send collectableAmount and hasTradeIn instead. This legacy format is deprecated. Use items so Keystone calculates the collectable amount.List available coupons
Returns the coupons the customer can apply to the cart, sorted by the largest discount first.
Request:
data array means no coupon applies to the cart.
Quote coupon
Checks a coupon code against the cart and returns the discount it applies. Call it when the customer enters a code, then send the same code ascouponCode in POST /orders.
Request:
When you send
items, Keystone prices the cart from its catalog and returns that value as subtotal, ignoring the subtotal you sent. Always send items so the discount matches checkout. eligibleCartAmount is the part of the cart the coupon applies to.
A coupon that is invalid, expired, fully used, or not applicable to the cart returns 400 with the reason in message.
Create order
Rules:
- When
shippingAddress.recipientNameis not sent, the customer profile must have a non-emptyname. itemsmust contain at least one product.productVariantIdis required for products with variants. Use thevariantsreturned by the product endpoints.quantitymust be an integer from1to9999.alternatePhone, when sent, must be 10 digits.paymentReturnUrl, when sent, must be an absolute URL.couponCodeis optional. Check it first withPOST /orders/coupon-quote.shippingAddress.landmarkis required.paymentModeacceptsPREPAIDorCOD. DefaultPREPAID.deliveryMethodacceptsSTANDARDorEXPRESS. DefaultSTANDARD.useRewardPoints: trueapplies eligible Reward Points. Defaultfalse.useWalletCash: trueapplies available Wallet Cash. Defaultfalse.- Send the same
useRewardPointsanduseWalletCashvalues you used for the quote.POST /wallet/quotedefaults both totrue, and order creation defaults both tofalse, so leaving them out gives a different amount.
paymentClientAction.type and paymentClientAction.payload to open the configured payment provider SDK. COD and orders with no external payment do not return a provider session.
List orders
Query parameters:
Request:
Retrieve order
Request:
List order invoices
Returns the invoices for an order. Orders can have aPRODUCT invoice and a DELIVERY invoice.
Request:
available is true when the PDF can be downloaded. Otherwise url is null, and status is PENDING, IN_PROGRESS, or FAILED. Check again later if an invoice is not yet available. An empty array means no invoice has been created for the order yet.
Download order invoice
Returns the invoice PDF.type is PRODUCT or DELIVERY.
Request:
Content-Type: application/pdf, not a JSON envelope. The API returns 404 if the invoice is not ready.
Initiate payment
Order creation initiates payment automatically. Call this endpoint if you need to retry or refresh a provider session for an existing prepaidPENDING_PAYMENT order.
Request:
clientAction.type and clientAction.payload to open the configured payment provider SDK.
Abandon payment
Call this endpoint when the customer closes an active provider checkout. The payment moves toUSER_DROPPED and can be retried with Initiate payment during the 2-minute grace period. A retry sent within a few seconds of abandoning can return 409 The previous payment session is still closing. Please retry shortly.; wait a few seconds and retry.
Request: