Add Item
This API is used to add line items to the cart.
Query Parameters
- cartId required
The unique id of the cart.
- application/json
Request Body required
- id number required
ID of the line items in the cart.
- locationId number required
An unique ID of the location.
- priceCategoryId number
An unique ID of the price category.
- quantity number required
Quantity of the line item to be added in cart.
- price number
Price of the line item to be added in cart.
groups object[] required
id number requiredAn unique id of the group.
itemId number requiredAn unique id of the item.
quantity number requiredQuantity of the items in the group.
Responses
- 200
- 404
- 409
Success response
- application/json
- Example
{
"statusCode": 200,
"data": {
"_id": "632488c1d491729ad937ac7d",
"locationId": 1364,
"bill": {
"subtotal": 180,
"tax": 0,
"taxes": [],
"discount": 0,
"discounts": [],
"charge": 0,
"charges": [],
"roundOff": 0,
"total": 180
},
"items": [
{
"_id": "632d9628841f6eea1486d359",
"variation": {
"_id": 352183,
"name": "Tomato Basil Penne Pasta"
},
"item": {
"_id": 343468,
"name": "Penne Pasta"
},
"category": {
"_id": 34259,
"name": "Pasta"
},
"inventoryId": 363731,
"name": "Tomato Basil Penne Pasta",
"quantity": 1,
"price": 180,
"mrp": 0,
"groups": [],
"subtotal": 180,
"tax": 0,
"discount": 0,
"total": 180,
"taxes": [],
"discounts": []
}
],
"__v": 0
}
}
Not found error response
- application/json
- Example
{
"statusCode": 400,
"message": "item / inventory not found",
"error": "Bad Request"
}
Conflict error response
- application/json
- Example
{
"statusCode": 409,
"message": "Your cart contains items of another store",
"error": "Conflict"
}