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

FieldTypeRequiredDescription
devicestringrequiredDevice type. Values: "WEB" | "MOBILE" | "APP"
transactionIdstringrequiredSame UUID used in select and init
pgstringrequiredPayment gateway. Currently: "RAZORPAY"
userIdstringrequiredYour own platform's user ID for the logged-in user (from your user management system)
mobilestringrequiredUser's mobile number
{
  "device": "WEB",
  "transactionId": "123f090-48b9-a9c5-6db5be6621dh",
  "pg": "RAZORPAY",
  "userId": "8f3a1c2e-9b4a-4e7c-b6d3-9a8f1e2d3c45",
  "mobile": "9876543210"
}

Response

FieldTypeDescription
orderIdstringInternal order ID. Save this for all subsequent order operations (track, status, cancel, rate, IGM).
paymentOrderIdstringPayment gateway order reference (e.g., HDFOOD0000000128)
pgstringPayment gateway used
orderStatusstringInitial status: "INITIATED"
transaction_idstringThe 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