Add item to a shopping cart
POST/api/cart/:id/item/add
Add an item to a shopping cart using its ID.
Request
Path Parameters
id stringrequired
The ID of the cart to which the item will be added
- application/json
Body
required
Array [
]
line_items
object[]
product_id number
ID of the product
variant_id number
ID of the variant (optional)
quantity number
price_data
object
unit_price number
tax number
currency string
compare_at number
shipping_id string
Responses
- 200
Successful addition of item to the cart
- application/json
- Schema
- Example (from schema)
- Example
Schema
any
{
"cart_id": "4c0010e7-c235-41ea-ab69-fba00be0ae6c",
"customer_session_id": "test-doc",
"shippingCountry": "c07d8af8-9d37-403b-aede-427c4b5fba3c",
"line_items": [
{
"id": "dac2ab8c-f2c2-4e64-abd6-ad824f226612",
"supplier": "Supplier name",
"product_available_shippings": [],
"product_id": 1230168,
"product_title": "Test",
"product_image": [
{
"id": 577005,
"url": "https://container.reachu.io/my-image.png",
"width": 500,
"height": 500
}
],
"variant_id": null,
"variant_title": null,
"variant": [],
"quantity": 1,
"shipping": null,
"price": {
"amount": 100,
"tax": 12,
"currencyCode": "EUR",
"discount": 0,
"compareAt": 0
}
}
],
"total_amount": 100,
"currency": "EUR",
"available_shipping_countries": [
"NO"
]
}
{
"cart_id": "4c0010e7-c235-41ea-ab69-fba00be0ae6c",
"customer_session_id": "test-doc",
"shippingCountry": "c07d8af8-9d37-403b-aede-427c4b5fba3c",
"line_items": [
{
"id": "dac2ab8c-f2c2-4e64-abd6-ad824f226612",
"supplier": "Supplier name",
"product_available_shippings": [],
"product_id": 1230168,
"product_title": "Test",
"product_image": [
{
"id": 577005,
"url": "https://container.reachu.io/my-image.png",
"width": 500,
"height": 500
}
],
"variant_id": null,
"variant_title": null,
"variant": [],
"quantity": 1,
"shipping": null,
"price": {
"amount": 100,
"tax": 12,
"currencyCode": "EUR",
"discount": 0,
"compareAt": 0
}
}
],
"total_amount": 100,
"currency": "EUR",
"available_shipping_countries": [
"NO"
]
}
Loading...