Skip to main content
Order and payment endpoints accept either customer authentication method described in Authentication.
Examples on this page use a Customer access token. With the Partner API key and External user ID method, replace the 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 409 Checkout idempotency key has already been used with a different payload. paymentReturnUrl is 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 409 Payment 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:
Response:
Send productVariantId for products with variants. items accepts up to 100 entries.

Get delivery quote

Query parameters: Request:
Response:

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:
Response:
Request fields: 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:
Response:
An empty 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 as couponCode in POST /orders. Request:
Response:
Request fields for both coupon endpoints: 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.recipientName is not sent, the customer profile must have a non-empty name.
  • items must contain at least one product.
  • productVariantId is required for products with variants. Use the variants returned by the product endpoints.
  • quantity must be an integer from 1 to 9999.
  • alternatePhone, when sent, must be 10 digits.
  • paymentReturnUrl, when sent, must be an absolute URL.
  • couponCode is optional. Check it first with POST /orders/coupon-quote.
  • shippingAddress.landmark is required.
  • paymentMode accepts PREPAID or COD. Default PREPAID.
  • deliveryMethod accepts STANDARD or EXPRESS. Default STANDARD.
  • useRewardPoints: true applies eligible Reward Points. Default false.
  • useWalletCash: true applies available Wallet Cash. Default false.
  • Send the same useRewardPoints and useWalletCash values you used for the quote. POST /wallet/quote defaults both to true, and order creation defaults both to false, so leaving them out gives a different amount.
Request:
Response:
Use 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:
Response:

Retrieve order

Request:
Response:

List order invoices

Returns the invoices for an order. Orders can have a PRODUCT invoice and a DELIVERY invoice. Request:
Response:
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:
The response is the PDF file with 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 prepaid PENDING_PAYMENT order. Request:
Response:
Use 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 to USER_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:
Response:
Payment statuses: