Create Order

Step 3 of the ONDC order flow. Creates the order and initiates the payment process. Must use the same transactionId from select and init.

Create Order

POST/ret11/orders/create-order
Auth Required

Include a Bearer token. See Authentication.

Request Body

Field Type Required Description
device string required Device type. Values: "WEB" | "MOBILE" | "APP"
transactionId string required Same UUID used in select and init
pg string required Payment gateway. Currently: "RAZORPAY"
userId string required Your own platform's user ID for the logged-in user (from your user management system)
mobile string required User's mobile number
{
  "device": "WEB",
  "transactionId": "123f090-48b9-a9c5-6db5be6621dh",
  "pg": "RAZORPAY",
  "userId": "8f3a1c2e-9b4a-4e7c-b6d3-9a8f1e2d3c45",
  "mobile": "9876543210"
}

Response

Field Type Description
orderId string Internal order ID. Save this for all subsequent order operations (track, status, cancel, rate, IGM).
paymentOrderId string Payment gateway order reference (e.g., HDFOOD0000000128)
pg string Payment gateway used
orderStatus string Initial status: "INITIATED"
transaction_id string The transaction ID (echoed back)
{
  "data": {
    "orderId": "019d1476113e75598fa4d0389075cef0",
    "paymentOrderId": "HDFOOD0000000128",
    "pg": "RAZORPAY",
    "orderStatus": "INITIATED",
    "transaction_id": "123f090-48b9-a9c5-6db5be6621dh"
  }
}
Payment Flow

After receiving the orderId, redirect the user to the payment gateway to complete payment. Once payment is done, call GET /ret11/orders/{orderId} to confirm payment success before showing a success screen.

Post-Payment Flow

  1. Call POST /ret11/orders/create-order → get orderId
  2. Redirect user to payment gateway using paymentOrderId
  3. After payment callback/redirect, call GET /ret11/orders/{orderId}
  4. If paymentOrderStatus === "SUCCESS", show order confirmation
  5. Use orderId for all future operations: track, status, cancel