Orders
This page contains the documentation for the orders endpoints.
The orders endpoints allow you to view your current orders. You can also add, modify and delete your orders with these endpoints.
This endpoint allows you to get the orders of the user. Order can either be:
pending
: Order is in thepending
state. It has not been delivered.delivery
: Order is in thedelivery
state. It is still in shipment and not completed.completed
: Order is completed an finalized.
To change the status of an order, use the POST Edit Orders endpoint.
Successful response. Returns all of the user's orders.
See message description.
see message description.
GET /orders/get_all HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Accept: */*
[
{
"orderId": "674b37b8dc3d9360b4c32e72",
"productId": "6555a1f49feeac7dccd9b1ee",
"image": "1700110836527.webp",
"name": "brown tablede",
"price": 30,
"quantity": 4,
"shipping": "Regular",
"status": "pending",
"createdAt": "November 30, 2024",
"orderNum": 1
},
{
"orderId": "674b37b8dc3d9360b4c32e72",
"productId": "655ff05e60b5a0bcc0a9314e",
"image": "1700786270864.webp",
"name": "Regular table",
"price": 100,
"quantity": 4,
"shipping": "Regular",
"status": "pending",
"createdAt": "November 30, 2024",
"orderNum": 1
}
]
This endpoint allows users to create a new order by providing the list of items they want to purchase along with the shipping address.
- Each item must include the product ID, quantity, and shipping type.
- The address field specifies the delivery address for the order.
Delivery address for the order.
Successful response. The order has been created successfully.
ORDER SUCCESS
See message description.
see message description.
POST /orders/add HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 215
{
"items": [
{
"product": "655ff05e60b5a0bcc0a9314e",
"quantity": 15,
"shipping": "Regular"
},
{
"product": "656427ab575db1ee43d46b57",
"quantity": 10,
"shipping": "Regular"
}
],
"address": "Post Office Pl, Carlton VIC 3053, Australia"
}
ORDER SUCCESS
This endpoint allows users to update the status of one or more orders. Valid status values include:
pending
: The order has not been delivered.delivery
: The order is in shipment.completed
: The order is finalized and delivered.
Users must provide the orderId
and the new status
for each order.
Successful response. Returns the updated orders with their details.
See message description.
see message description.
POST /orders/change-status HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 130
{
"items": [
{
"orderId": "674b46f1dc3d9360b4c32ee2",
"status": "delivery"
},
{
"orderId": "674b46a8dc3d9360b4c32ede",
"status": "completed"
}
]
}
[
{
"_id": "674b46a8dc3d9360b4c32ede",
"user": "672050a27def4d23ffcb5166",
"items": [
{
"product": "6555a1f49feeac7dccd9b1ee",
"quantity": 4,
"shipping": "Regular",
"_id": "674b46a8dc3d9360b4c32edf"
},
{
"product": "6555a2779feeac7dccd9b201",
"quantity": 3,
"shipping": "Regular",
"_id": "674b46a8dc3d9360b4c32ee0"
}
],
"status": "completed"
}
]
This endpoint allows users to delete one or more orders.
- Users must provide the
orderId
of each order to be deleted. - The response confirms whether the operation was successful and the number of orders deleted.
List of order IDs to be deleted.
Successful response. Confirms the number of deleted orders.
See message description.
see message description.
POST /orders/delete HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 67
{
"orderId": [
"674b46f1dc3d9360b4c32ee2",
"674b46a8dc3d9360b4c32ede"
]
}
{
"acknowledged": true,
"deletedCount": 2
}
Last updated