Orders Endpoint
TIP
Refer to products page for Base URL
* Place An Order
Endpoint: POST
orders/Request Headers
| Authorization | Value | Description | Required |
|---|---|---|---|
| Bearer | ******* | Firebase access token | ✔️ |
Payload Description
| Name | Type | Description | Required |
|---|---|---|---|
| isPayNow | boolean | if user want to pay now or not | ✔️ |
| userName | string | authenticated user name | ✔️ |
| deliveryAddress | object | address of user delivery method is selected | ❌ |
| deliveryType | string | options can be delivery, collection | ✔️ |
| items | array of objects | product_id, size, color, etc | ✔️ |
Sample Payload
{
"isPayNow": true,
"userName": "Samuel Kofi Gyimah",
"deliveryAddress": {
"city": "accra",
"region": "Greater Accra",
"name": "Sam",
"email": "sam.wookin@gmail.com",
"phone": "+233 5535 10672"
},
"method": "Delivery",
"items": [
{
"slug": "new-product-5-1692",
"size": "43",
"color": {
"code": "#123",
"name": "red"
},
"quantity": 2,
"deliveryPrice": 12.00
}
]
}Sample Response
If isPayNow: true
{
"status": "OK",
"reason": "Checkout Initiation accepted",
"referenceid": "12LIAE",
"responsetoken": "J9Au4fs/uqaiYWcP3F5V1fvgHGNXIuFk2X58PzcAKaw=",
"checkouturl": "https://checkout.reddeonline.com?token=J9Au4fs%2FuqaiYWcP3F5V1fvgHGNXIuFk2X58PzcAKaw%3D",
"checkouttransid": 604702
}If isPayNow: false
{
"data": "order placed ",
"status": 201
}* User's Orders
Endpoint: GET
orders/userRequest Headers
| Authorization | Value | Description | Required |
|---|---|---|---|
| Bearer | ******* | Firebase access token | ✔️ |
Parameters
Not required
Sample Response
{
"count": 19,
"next": null,
"previous": null,
"results": [
{
"orderNumber": "#KM0AS2H9WRT7",
"deliveryType": "Delivery",
"transactionStatus": "Processing",
"totalPrice": "130.00",
"dateOrdered": "2023-06-03T15:05:41.536805Z"
},
{
"orderNumber": "#KFFQGC0X0981",
"deliveryType": "Delivery",
"transactionStatus": "Processing",
"totalPrice": "130.00",
"dateOrdered": "2023-06-03T11:40:50.637446Z"
}
]
}* Filter By Order Number
Endpoint: GET
orders/filter/Request Headers
| Authorization | Value | Description | Required |
|---|---|---|---|
| Bearer | ******* | Firebase access token | ✔️ |
Query Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| orderNumber | string | eg. #QIENJBFFX4O8 | ✔️ |
Sample Request
orders/filter/?orderNumber=#QIENJBFFX4O8Sample Response
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"product": {
"name": "Turkey Muslim Maxi Dress - Black",
"slug": "turkey-muslim-maxi-dress-black-7547",
"images": [
"http://127.0.0.1:8000/media/products/2023%20-%2001/2.jpg",
"http://127.0.0.1:8000/media/products/2023%20-%2001/1.jpg"
],
},
"status": "Processing",
"size": "43",
"color": {
"code": "#123",
"name": "red"
},
"quantity": 1,
"salePrice": "887.50",
"deliveryPrice": "10.00",
"store": {
"name": "Sam-Kay Fashion Store",
"id": "0e91a1fb-a8e9-4bea-80db-7f745cfb112c",
"slug": "sam-kay-fashion-store-9207"
}
},
]
}
Wookein Docs