Get Orders
Get a paginated list of orders with optional filters such as date range and pagination parameters.
Endpoint
GET /v1/orders/b2b/delivery-partners/{dpID}
Headers
| Header | Type | Description | Required |
|---|---|---|---|
x-client-id | String | Your clientID | ✅ Yes |
x-client-secret | String | Your clientSecret | ✅ Yes |
Path Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
dpID | String | Your delivery partner ID | ✅ Yes |
Query Parameters
| Parameter | Type | Description | Required | Default |
|---|---|---|---|---|
nextCursor | String | Pagination cursor for next page | ❌ No | - |
limit | Integer | Number of records per page | ❌ No | 15 |
Pagination Limits
- Default limit: 15 records per page
- Maximum limit: 100 records per page
Example Request
Get First Page of Orders
curl --location 'https://stage-platform-exlr8.exlr8now.com/v1/orders/b2b/delivery-partners/YOUR_DP_ID' \
--header 'x-client-id: YOUR_CLIENT_ID' \
--header 'x-client-secret: YOUR_CLIENT_SECRET'
Get Orders with Pagination
curl --location 'https://stage-platform-exlr8.exlr8now.com/v1/orders/b2b/delivery-partners/YOUR_DP_ID' \
--data-urlencode 'limit={limit}' \
--data-urlencode 'nextCursor={nextCursor}' \
--header 'x-client-id: YOUR_CLIENT_ID' \
--header 'x-client-secret: YOUR_CLIENT_SECRET'
Response
Successful Response
{
"orders": [
{
"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
}
]
}
],
"paginationInfo": {
"nextCursor": "",
"hasMore": false
}
}
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
| Field | Type | Description |
|---|---|---|
orders | Array | Array of order objects |
paginationInfo | Object | Pagination information |
Pagination Info
| Field | Type | Description |
|---|---|---|
nextCursor | String | Cursor for the next page (empty if no more pages) |
hasMore | Boolean | Whether more records are available |
Pagination Example
// Example: Fetch all orders
let allOrders = [];
let nextCursor = null;
do {
const url = nextCursor
? `${baseUrl}/orders/b2b/delivery-partners/${dpID}?nextCursor=${nextCursor}`
: `${baseUrl}/orders/b2b/delivery-partners/${dpID}`;
const response = await fetch(url, {
headers: {
"x-client-id": clientId,
"x-client-secret": clientSecret,
},
});
const data = await response.json();
allOrders.push(...data.orders);
nextCursor = data.paginationInfo.hasMore
? data.paginationInfo.nextCursor
: null;
} while (nextCursor);
Error Responses
Unauthorized Access
{
"error": "unauthenticated",
"errCode": "UNAUTHORIZED"
}
Invalid DP ID
{
"error": "forbidden: param: admin user does not have access to DP: INVALID_DP_ID",
"errCode": "FORBIDDEN"
}
Use Cases
1. Order History Dashboard
Display recent orders with pagination for your users.
2. Reconciliation
Fetch all orders for a specific time period to reconcile with your records.
3. Status Monitoring
Regularly poll for orders that need status updates.
Best Practices
- Use Pagination: Don't try to fetch all orders at once
- Implement Caching: Cache order data to reduce API calls
- Handle Empty Results: Gracefully handle cases with no orders
- Monitor Performance: Use appropriate page sizes for your use case
Related Endpoints
- Get Order by ID - Get specific order details
- Get Order by External Ref - Find order by your reference
- Place Order - Create new orders