Create Order
Create a new order in your store.
Endpoint
POST /api/orders/createRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
| customer | object | Yes | Customer info |
| details | array | Yes | Array of order details |
| shipping | object | No | Shipping info |
| discount | object | No | Discount info |
| attachments | array | No | Attachments |
| bookingInfo | object | No | Booking info |
| status | string | No | Order status |
| payment | object | No | Payment info |
| method | object | No | Payment method |
| customerNote | string | No | Customer note |
Example
json
{
"customer": {
"_id": "customer_id",
"firstname": "John",
"lastname": "Doe",
"email": "john@example.com"
},
"details": [
{
"product": {
"_id": "product_id",
"name": "T-shirt",
"price": {
"buyingPrice": 0,
"salePrice": 2,
"comparePrice": 0
},
},
"variant":{
"_id": "variant_id",
"name": "Color : Red | Size : XS"
}, //variant optional
"quantity": 2,
"price": 40
}
],
"method":{
"_id": "5feb408a2ef4130539efb9e0",
"name": "CashOnDelivery"
},
"shipping": {
"isFixed": false,
"zone": { "_id": "zone_id", "name": "Zone 1" }, //optional
"shipper": { "_id": "shipper_id", "name": "DHL" }, //optional
"price": 10,
"address": {
"firstname": "John",
"lastname": "Doe",
"address1": "123 Main St",
"city": { "_id": "city_id", "name": "City" }, //optional
"country": { "_id": "country_id", "name": "Country" } //optional
}
},
"discount": {
"_id": "discount_id",
"price": 5
},
"status": "PENDING",
"customerNote": "Please deliver between 9am-5pm"
}Response
json
{
"status": "success",
"data": {
"_id": "string",
"orderId": 1234,
...
}
}