Skip to main content

Place Order

Place a new order using a unique external reference and product variant.

Endpoint

POST /v1/orders/b2b/direct-checkout

Headers

HeaderTypeDescriptionRequired
x-client-idStringYour clientID✅ Yes
x-client-secretStringYour clientSecret✅ Yes
Content-TypeStringMust be application/json✅ Yes

Request Body

For Product Orders

FieldTypeDescriptionRequired
dpIDStringYour delivery partner ID (same as clientID)✅ Yes
variantIDStringProduct variant identifier✅ Yes
externalRefIDStringUnique reference ID provided by client❌ No
{
"dpID": "{YOUR_DP_ID}",
"variantID": "VAR-23c2a475-06cb-4118",
"externalRefID": "{uniqueRefIDToBeProvidedByClient}"
}
Unique External Reference

The externalRefID must be unique for each order. This is your reference for tracking the order in your system.

Example Request

curl --location 'https://stage-platform-exlr8.exlr8now.com/v1/orders/b2b/direct-checkout' \
--header 'x-client-id: YOUR_CLIENT_ID' \
--header 'x-client-secret: YOUR_CLIENT_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"dpID": "{YOUR_DP_ID}",
"variantID": "VAR-23c2a475-06cb-4118",
"externalRefID": "order-07-09-2025"
}'

Response

Successful Response

{
"orderID": "ORDIN0912202528cce89",
"externalRefID": "order-07-09-2025",
"dpUserEmail": "[email protected]",
"dpUserName": "Demo Intl Test Dp",
"dpID": "daa30819-8150-4490-b20f-65b75cb148ba",
"totalOrderMRP": 2448.44,
"totalAmount": 2448.44,
"totalCostPrice": 0,
"dpSellingPrice": 0,
"subDpSellingPrice": 0,
"currency": "INR",
"status": "COMPLETED",
"fulfillmentStatus": "FULFILLED",
"createdAt": "2025-12-09T07:40:30.72Z",
"updatedAt": "2025-12-09T07:40:30.777Z",
"assetURL": "",
"type": "DIRECT_CHECKOUT",
"lineItems": [
{
"variantID": "VAR-23c2a475-06cb-4118",
"productID": "PROD-cd250a2a-2b27-40e0",
"quantity": 1,
"mrp": 100,
"price": 100,
"totalMRP": 100,
"totalPrice": 100,
"totalConvertedPrice": 2448.44,
"totalItemCostPrice": 0,
"currency": "AED",
"fxRate": 24.4844,
"markUpPercentage": 0,
"variantName": "TEST_PRODUCT_1_DP_APIS INR 100",
"productName": "TEST_PRODUCT_1_DP_APIS",
"variantDisplayName": "₹ 100",
"productDisplayName": "TEST_PRODUCT_1_DP_APIS",
"attachments": [
"https://storage.googleapis.com/exlr8-assets/voucher_bulk_uploads/default_voucher.jpg"
],
"mobileNumbers": null,
"vouchers": [
{
"voucherCode": "89868092",
"voucherPin": "T5R9-Q2M8-C6V2748",
"expirationDate": "2028-01-01T00:00:00Z"
}
],
"fulfillmentStatus": "FULFILLED",
"allocatedQty": 1,
"fulfilledQty": 1
}
]
}
Order Currency Conversion

In the order response, the line item currency is AED, and the totalConvertedPrice (2448.44) is calculated by converting the totalPrice (100) using the fxRate (24.4844) to your selected wallet currency (INR). This ensures the order amount deducted from your wallet is in your selected currency.

Response Fields

FieldTypeDescription
orderIDStringSystem-generated unique order identifier
externalRefIDStringYour provided external reference
dpUserEmailStringEmail of the DP user
dpUserNameStringName of the DP user
dpIDStringYour delivery partner ID
totalOrderMRPNumberTotal MRP of the order in the selected wallet currency
totalAmountNumberTotal amount charged in the selected wallet currency
totalCostPriceNumberTotal cost price
dpSellingPriceNumberDP selling price
subDpSellingPriceNumberSub-DP selling price
currencyStringOrder currency
statusStringOrder status (see Status Codes)
fulfillmentStatusStringFulfillment status (see Status Codes)
createdAtStringOrder creation timestamp (ISO 8601)
updatedAtStringLast update timestamp (ISO 8601)
assetURLStringURL to download order details (when fulfilled)
typeStringOrder type
lineItemsArrayArray of ordered items with details

Line Item Fields

FieldTypeDescription
variantIDStringProduct variant identifier
productIDStringProduct identifier
quantityNumberQuantity ordered
mrpNumberMaximum retail price per unit
priceNumberActual price charged per unit
totalMRPNumberTotal maximum retail price for the line item
totalPriceNumberTotal actual price charged for the line item
totalConvertedPriceNumberTotal converted price for the line item in the selected DP wallet currency
totalItemCostPriceNumberTotal cost price for the line item
currencyStringLine item currency
fxRateNumberForeign exchange rate used
markUpPercentageNumberMarkup percentage applied
variantNameStringVariant name
productNameStringProduct name
variantDisplayNameStringDisplay name for the variant
productDisplayNameStringDisplay name for the product
attachmentsArrayArray of attachment URLs (e.g., images or documents)
mobileNumbersArrayArray of mobile numbers (if applicable, e.g., for SIM cards)
vouchersArrayVoucher details (when fulfilled) - see Voucher Fields
fulfillmentStatusStringItem fulfillment status (see Status Codes)
allocatedQtyNumberQuantity allocated
fulfilledQtyNumberQuantity fulfilled

Voucher Fields

When vouchers are available (order status is COMPLETED and fulfillment status is FULFILLED), each voucher object contains:

FieldTypeDescription
voucherCodeStringThe voucher code to be used by the customer
voucherPinStringThe voucher PIN for activation
expirationDateStringVoucher expiration date (ISO 8601 format)

Example voucher object:

{
"voucherCode": "78776667",
"voucherPin": "T6R9-Q3M8-C4VVB1200",
"expirationDate": "2028-01-02T00:00:00Z"
}

Order Status Codes

The order will have one of two final statuses:

StatusDescriptionNext Steps
COMPLETEDOrder successfully completedDownload vouchers if available
FAILEDOrder failed during processingCheck error details and retry

Asset Download

When order status is COMPLETED and fulfillmentStatus is FULFILLED:

  1. Download the file from assetURL.
  2. Use the password sent over email to open the file.
  3. Extract voucher information for delivery to your customers.

Error Responses

Insufficient Balance

{
"error": "insufficient wallet balance",
"errCode": "INSUFFICIENT_BALANCE"
}

Product Not Available

{
"error": "insufficient stock for variant VARIANT_ID. Available: AVAILABLE_STOCK_COUNT, Requested: REQUESTED_STOCK_COUNT",
"errCode": "OUT_OF_STOCK"
}

Invalid Request

{
"error": "invalid variant ID",
"errCode": "BAD_REQUEST"
}

Best Practices

  1. Unique External References: Always use unique externalRefID values
  2. Error Handling: Implement proper error handling for all response codes
  3. Status Check: Check order status to see if it's COMPLETED or FAILED
  4. Asset Download: Download and securely store voucher files when status is COMPLETED