Cart
This page contains the documentation for the cart endpoints.
The cart endpoints allow you to add items in your cart and look at what you currently have in there. You can also modify the number of items and remove items in the cart.
This endpoint allows you add items to your cart.
Provide your API key.
The ID of the product. You can use the GET Product list endpoint to view available products and it's ID.
The quantity of items to add.
Successful response. Returns the result of the operation.
Successful operation.
POST REQUEST SUCCESSSee message description.
see message description.
POST /cart/add HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 54
{
"productId": "6555a1f49feeac7dccd9b1ee",
"quantity": 20
}POST REQUEST SUCCESSThis endpoint allows you get the current items in your cart.
Provide your API key.
Successful response. Returns the list of items in your cart.
See message description.
see message description.
GET /cart/items HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Accept: */*
{
"_id": "6556aed27e6cd0b318dbb08d",
"user": {
"_id": "6555a0f89feeac7dccd9b1dd",
"name": "first account",
"email": "[email protected]"
},
"items": [
{
"product": {
"_id": "6555a2269feeac7dccd9b1f2",
"name": "White desk",
"image": "1700110886749.webp",
"price": 60,
"description": "Maecenas at justo eu eros ultrices vulputate vitae at augue.",
"soldCount": 99,
"__v": 0
},
"quantity": 20,
"_id": "67498e75990ee7506c8ee954"
},
{
"product": {
"_id": "655fefee60b5a0bcc0a9313c",
"name": "stool",
"image": "1700786158091.webp",
"price": 60,
"description": "Umde",
"soldCount": 1,
"__v": 0
},
"quantity": 25,
"_id": "67498e82990ee7506c8ee958"
}
],
"__v": 100
}This endpoint allows you to update the quantity of a product in the cart.
Provide your API key.
Unique identifier of the product to update.
New quantity of the product.
Successful response. Returns the items in the cart.
See message description.
see message description.
PUT /cart/edit HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 54
{
"productId": "655fefee60b5a0bcc0a9313c",
"quantity": 40
}{
"_id": "6556aed27e6cd0b318dbb08d",
"user": "6555a0f89feeac7dccd9b1dd",
"items": [
{
"product": "6555a2269feeac7dccd9b1f2",
"quantity": 30,
"_id": "67498e75990ee7506c8ee954"
},
{
"product": "655fefee60b5a0bcc0a9313c",
"quantity": 40,
"_id": "67498e82990ee7506c8ee958"
}
],
"__v": 100
}This endpoint allows you to delete specified items from the user's cart.
Provide your API key.
List of product IDs to remove from the cart.
Successful response. Returns the updated cart after deletion.
See message description.
see message description.
DELETE /cart/delete HTTP/1.1
Host: thefurniturebros.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 38
{
"items": [
"67498e75990ee7506c8ee954"
]
}{
"_id": "6556aed27e6cd0b318dbb08d",
"user": "6555a0f89feeac7dccd9b1dd",
"items": [
{
"product": "655fefee60b5a0bcc0a9313c",
"quantity": 40,
"_id": "67498e82990ee7506c8ee958"
},
{
"product": "65653baad868691c42306f7f",
"quantity": 41,
"_id": "6749904c990ee7506c8ee97d"
}
],
"__v": 101
}Last updated