Get Cart Details
The "Get Cart Items Details" API allows the client to retrieve the details of items added to the shopping cart. This API allows authenticated customers to retrieve the details of items in their shopping cart and returns an array of items with their respective details such as name, price, quantity, and image URL.
Endpoint:
api/customer/carts
Http Method:
GET
tip
You can retrieve a list of items in the cart from either the "List Cart Items Details" API or the Initialize API. The "List Cart Items Details" API provides detailed information about the items, while the "Initialize" API includes a summary of the cart.
- Success Response:
Key | Type | Description |
---|---|---|
grand_total | Integer | The total amount of the items in the cart, including any applicable discounts, or shipping fees. |
can_checkout | Boolean | A boolean value indicating whether the user can proceed to the checkout process. It can be used to determine if the cart meets certain conditions for checkout, such as minimum order requirements. |
items | Array | An array that holds the cart items. Each item represents a product added to the cart and contains information such as the product ID, quantity, price, and attributes. |
gifts | Array | An array that stores any gifts or promotional items associated with the cart. These items are typically added based on specific promotions or customer actions. |
suggestions | Integer | An array that provides suggestions or recommendations for additional products that the user may consider adding to the cart from promotion. |
isApplied | Boolean | A boolean value indicating whether any promotions or discounts have been applied to the cart. |
{
"code": 200,
"data": {
"grand_total": 450,
"can_checkout": true,
"items": [
{
"id": 127431,
"sku": "40702",
"name_en": "Bionike Volume Mascara 8 ml",
"name_ar": "بيونيكيه ماسكارا مكثّفة للرموش 8 مل",
"slug": "bionike-volume-mascara-8-ml-1682774811",
"image": "https://docapi.supercommerce.io",
"available_soon": false,
"price": 450,
"brand": {
"id": 8743,
"name": "BioNike",
"name_ar": "بيونيكيه",
"image": "https://docapi.supercommerce.io",
},
"discount_price": null,
"has_promotion": false,
"discount_start_date": null,
"discount_end_date": null,
"discount_max_per_period": null,
"discount_period_cycle_days": null,
"direct_discount": false,
"in_stock": true,
"stock": 477,
"promotion_en": null,
"promotion_ar": null,
"is_favourite": false,
"is_compare": false,
"promos": [],
"active": true,
"amount": 1,
"can_buy": 477,
"type": 1,
}
],
"gifts": [],
"suggestions": [],
"isApplied": false
}
}
- Failure Response:
The cart was empty
{
"code": 200,
"data": {
"grand_total": null,
"can_checkout": true,
"items": [],
"gifts": [],
"suggestions": [],
"isApplied": false
}
}
- Success Response:
{
"code": 200,
"message": "Success",
"data": {
"grand_total": 450,
"can_checkout": true,
"items": [
{
"id": 127431,
"parent_id": 127430,
"sku": "40702",
"barcode": "",
"name": "Bionike Volume Mascara 8 ml",
"name_en": "Bionike Volume Mascara 8 ml",
"name_ar": "بيونيكيه ماسكارا مكثّفة للرموش 8 مل",
//...
}
],
"gifts": [],
"suggestions": [],
"isApplied": false
},
"meta": []
}
info
Check the following section to learn more about the Get Cart Details API Reference