Documentation is still being updated. Some content maybe unfinished.
curl --request POST \
--url {protocol}://{host}/wp-json/cocart/v2/cart/add-items \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"id": "<string>",
"quantity": "1",
"variation": {},
"item_data": {}
}
],
"email": "jsmith@example.com",
"phone": "<string>",
"return_items": false
}
'[
{
"item_key": "<string>",
"id": 123,
"name": "<string>",
"title": "<string>",
"price": "<string>",
"quantity": {
"value": 123,
"min_purchase": 123,
"max_purchase": 123
},
"totals": {
"subtotal": 123,
"subtotal_tax": 123,
"total": 123,
"tax": 123
},
"slug": "<string>",
"meta": {
"product_type": "<string>",
"sku": "<string>",
"dimensions": {
"length": "<string>",
"width": "<string>",
"height": "<string>",
"unit": "<string>"
},
"weight": "<string>",
"variation": {}
},
"backorders": "<string>",
"cart_item_data": {},
"featured_image": "<string>"
}
]Adds multiple product items to the customer’s cart in a single request.
A valid request URL is required to generate request examples[
{
"item_key": "<string>",
"id": 123,
"name": "<string>",
"title": "<string>",
"price": "<string>",
"quantity": {
"value": 123,
"min_purchase": 123,
"max_purchase": 123
},
"totals": {
"subtotal": 123,
"subtotal_tax": 123,
"total": 123,
"tax": 123
},
"slug": "<string>",
"meta": {
"product_type": "<string>",
"sku": "<string>",
"dimensions": {
"length": "<string>",
"width": "<string>",
"height": "<string>",
"unit": "<string>"
},
"weight": "<string>",
"variation": {}
},
"backorders": "<string>",
"cart_item_data": {},
"featured_image": "<string>"
}
]Items added to cart successfully.
Unique identifier for the item within the cart.
Product ID.
Product name.
Product title.
Current product price.
Quantity information for this item.
Show child attributes
Item totals.
Show child attributes
Product slug.
Item metadata.
Show child attributes
Backorder status.
Custom cart item data.
Product featured image URL.
Was this page helpful?