Orders
Get all orders
GET stores/{store_id}/orders?
This endpoint lets you get all orders for a specific store.
Headers
Authorization
string
Bearer token.
Query parameters
page
integer
Page number for pagination. Default is 1.
limit
integer
Number of orders per page. Default is 20.
status
string
Filter orders by status. Options are pending, paid, processing, shipped, delivered, cancelled, refunded.
search
string
Search in orderCode, customerEmail, customerName, items.name. String is case-insensitive.
startDate
string
Filter orders created on or after this date. ISO date string.
endDate
string
Filter orders created on or before this date. ISO date string.
sortBy
string
Field to start sort by. Options are createdAt, updatedAt, totalAmount, status, orderCode.
sortOrder
string
Sort direction. Options are desc, asc. Default is desc.
Response
{
"success": true,
"message": "Orders retrieved successfully",
"data": {
"orders": [
{
"_id": "672355f432116c6197fbf242",
"store": "692565f432118c6197abf2ec",
"user": "507f191e810c19729de860ea",
"stripeSessionId": "cs_test_a1B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6",
"stripePaymentIntentId": "pi_1234567890abcdef",
"stripeCustomerId": "cus_1234567890abcdef",
"customerEmail": "[email protected]",
"customerPhone": "+1234567890",
"customerName": "John Doe",
"items": [
{
"product": "507f1f77bcf86cd799439012",
"name": "Premium Wireless Headphones",
"description": "High-quality wireless headphones with noise cancellation",
"quantity": 1,
"unitPrice": 99.99,
"totalPrice": 99.99,
"sku": "HW-001",
"images": [
"https://example.com/images/headphones-1.jpg",
"https://example.com/images/headphones-2.jpg"
]
}
],
"subtotal": 99.99,
"taxAmount": 2.00,
"shippingCost": 5.99,
"totalAmount": 107.98,
"currency": "usd",
"shippingAddress": {
"name": "John Doe",
"line1": "123 Main Street",
"line2": "Apt 4B",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "US"
},
"shippingOption": {
"name": "Standard Shipping",
"amount": 5.99,
"deliveryEstimate": {
"minimum": {
"unit": "business_day",
"value": 3
},
"maximum": {
"unit": "business_day",
"value": 5
}
}
},
"orderNotes": "Please leave package at front door",
"status": "paid",
"paymentStatus": "paid",
"trackingNumbers": [],
"stripeTransferId": "tr_1234567890abcdef",
"transferAmount": 102.99,
"platformFeeAmount": 5.00,
"transferStatus": "transferred",
"transferredAt": "2024-01-15T10:30:00.000Z",
"paidAt": "2024-01-15T10:00:00.000Z",
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-01-15T10:00:00.000Z"
}
],
"pagination": {
"currentPage": 1,
"totalPages": 1,
"totalOrders": 1,
"hasNextPage": false,
"hasPrevPage": false
}
}
}Get order details
GET /stores/{store_id}/orders/{order_id}
This endpoint lets you get order details.
Headers
Authorization
string
Bearer token.
Response
Update order status
PUT /stores/{store_id}/orders/{order_id}
This endpoint lets you update the status of an order.
Headers
Authorization
string
Bearer token.
Body request
Response
Last updated
Was this helpful?