Zoey REST API reference ยท Interactive version: apidocs.zoey.com
POST https://container-url.zoeysite.com/api/rest/checkout2/cart_product
Adding a product to a cart will sometimes require more than just the Product ID. Depending on the specifications of the product you may need to set a specific qty or options, or even super_group or super_attribute, depending on which type of product you are adding.
For more examples of how to add different products, use the example drop-down to change the Example Request.
return_data must be sent in the query string, e.g. POST /checkout2/cart_product?return_data=items. It is not read from the request body.
Without return_data, a successful call returns true.
With ?return_data=items, it returns the cart and one entry per product in the request, in the same order:
{
"cartId": 123,
"items": [
{ "item_id": 9001, "product_id": 12, "sku": "A", "qty": 2 },
{ "item_id": 9003, "product_id": 80, "sku": "C-RED-L", "qty": 1, "variation_product_id": 84 },
{ "product_id": 70, "sku": "G", "items": [
{ "item_id": 9010, "product_id": 71, "sku": "G-1", "qty": 2 },
{ "item_id": 9011, "product_id": 72, "sku": "G-2", "qty": 1 }
] }
]
}
Notes:
Adding a product that is already in the cart with the same options merges into that line. Its entry returns the existing item_id and the combined qty. Send unique_in_quote: 1 to get a separate line.
If the same product appears twice in one request and merges, both entries return the same item_id.
If any product fails to add, the call returns an error and nothing is added.
An item_id of null means the product was added but its ID couldn't be returned. Don't retry the add; get the ID with GET /checkout2/cart_product?id=.
Example request body:
{
"cartId": "51",
"products": [
{
"product_id": "1177",
"qty": "1",
"custom_price": 10,
"use_discount": 1
},
{
"product_id": "1161",
"qty": "1",
"custom_price": 10,
"use_discount": 1,
"super_attribute": {
"92": "23"
}
},
{
"product_id": "1161",
"qty": "1",
"custom_price": 80,
"use_discount": 1,
"super_attribute": {
"92": "28"
}
}
],
"storeId": null,
"clearPreviousItems": false
}
Example response (Product Types), HTTP 200:
true
GET https://container-url.zoeysite.com/api/rest/checkout2/cart_product?id=51
Adding a product to a cart will sometimes require more than just the Product ID. Depending on the specifications of the product you may need to set a specific qty or options or even super_group or super_attribute depending on which type of product you are adding.
For more examples of how to add different product, use the example drop down to change the Example Request.
Query parameters:
| Name | Example | Notes |
|---|---|---|
id | 51 |
PUT https://container-url.zoeysite.com/api/rest/checkout2/cart_product
Item identifier is required. You can identify an item by either:
Adding a product to a cart will sometimes require more than just the Product ID. Depending on the specifications of the product you may need to set a specific qty or options or even super_group or super_attribute depending on which type of product you are adding.
For more examples of how to add different product, use the example drop down to change the Example Request.
Example request body:
{
"cartId": "51",
"products": [
{
"item_id": "2355",
"qty": "2",
"use_discount": 1
}
]
}
DELETE https://container-url.zoeysite.com/api/rest/checkout2/cart_product
Item identifier is required. You can identify an item by either:
Example request body:
{
"cartId": "51",
"products": [
{
"product_id": "1"
}
]
}