Documentation is still being updated. Some content maybe unfinished.
curl --request PUT \
--url {protocol}://{host}/wp-json/cocart/v2/cart/item/{item_key}{
"cart_hash": "<string>",
"cart_key": "<string>",
"currency": {
"currency_code": "<string>",
"currency_symbol": "<string>",
"currency_symbol_pos": "<string>",
"currency_minor_unit": 123,
"currency_decimal_separator": "<string>",
"currency_thousand_separator": "<string>",
"currency_prefix": "<string>",
"currency_suffix": "<string>"
},
"customer": {
"billing_address": {
"billing_first_name": "<string>",
"billing_last_name": "<string>",
"billing_company": "<string>",
"billing_country": "<string>",
"billing_address_1": "<string>",
"billing_address_2": "<string>",
"billing_postcode": "<string>",
"billing_city": "<string>",
"billing_state": "<string>",
"billing_phone": "<string>",
"billing_email": "<string>"
},
"shipping_address": {
"shipping_first_name": "<string>",
"shipping_last_name": "<string>",
"shipping_company": "<string>",
"shipping_country": "<string>",
"shipping_address_1": "<string>",
"shipping_address_2": "<string>",
"shipping_postcode": "<string>",
"shipping_city": "<string>",
"shipping_state": "<string>"
}
},
"items": {},
"item_count": 123,
"items_weight": 123,
"coupons": [
{
"coupon": "<string>",
"label": "<string>",
"saving": "<string>",
"saving_html": "<string>"
}
],
"needs_payment": true,
"needs_shipping": true,
"shipping": {
"total_packages": 123,
"show_package_details": true,
"has_calculated_shipping": true,
"packages": {}
},
"fees": [
{
"name": "<string>",
"amount": 123,
"taxable": true,
"tax_class": "<string>",
"total": 123,
"tax": 123
}
],
"taxes": [
{
"rate_id": 123,
"label": "<string>",
"compound": true,
"tax_total": "<string>",
"shipping_tax_total": "<string>"
}
],
"totals": {
"subtotal": "<string>",
"subtotal_tax": "<string>",
"shipping_total": "<string>",
"shipping_tax": "<string>",
"shipping_taxes": [
123
],
"discount_total": "<string>",
"discount_tax": "<string>",
"cart_contents_total": "<string>",
"cart_contents_tax": "<string>",
"cart_contents_taxes": [
123
],
"fee_total": "<string>",
"fee_tax": "<string>",
"fee_taxes": [
123
],
"total": "<string>",
"total_tax": "<string>"
},
"removed_items": [
{
"key": "<string>",
"product_id": 123,
"quantity": 123,
"name": "<string>"
}
],
"cross_sells": [
{
"id": 123,
"product_name": "<string>",
"product_title": "<string>",
"price": "<string>",
"regular_price": "<string>",
"sale_price": "<string>",
"product_image": "<string>"
}
],
"notices": {},
"extensions": {}
}Restores a previously removed item back to the customer’s cart. By default returns the updated cart contents. Set return_item=true to get just the restored item details.
curl --request PUT \
--url {protocol}://{host}/wp-json/cocart/v2/cart/item/{item_key}{
"cart_hash": "<string>",
"cart_key": "<string>",
"currency": {
"currency_code": "<string>",
"currency_symbol": "<string>",
"currency_symbol_pos": "<string>",
"currency_minor_unit": 123,
"currency_decimal_separator": "<string>",
"currency_thousand_separator": "<string>",
"currency_prefix": "<string>",
"currency_suffix": "<string>"
},
"customer": {
"billing_address": {
"billing_first_name": "<string>",
"billing_last_name": "<string>",
"billing_company": "<string>",
"billing_country": "<string>",
"billing_address_1": "<string>",
"billing_address_2": "<string>",
"billing_postcode": "<string>",
"billing_city": "<string>",
"billing_state": "<string>",
"billing_phone": "<string>",
"billing_email": "<string>"
},
"shipping_address": {
"shipping_first_name": "<string>",
"shipping_last_name": "<string>",
"shipping_company": "<string>",
"shipping_country": "<string>",
"shipping_address_1": "<string>",
"shipping_address_2": "<string>",
"shipping_postcode": "<string>",
"shipping_city": "<string>",
"shipping_state": "<string>"
}
},
"items": {},
"item_count": 123,
"items_weight": 123,
"coupons": [
{
"coupon": "<string>",
"label": "<string>",
"saving": "<string>",
"saving_html": "<string>"
}
],
"needs_payment": true,
"needs_shipping": true,
"shipping": {
"total_packages": 123,
"show_package_details": true,
"has_calculated_shipping": true,
"packages": {}
},
"fees": [
{
"name": "<string>",
"amount": 123,
"taxable": true,
"tax_class": "<string>",
"total": 123,
"tax": 123
}
],
"taxes": [
{
"rate_id": 123,
"label": "<string>",
"compound": true,
"tax_total": "<string>",
"shipping_tax_total": "<string>"
}
],
"totals": {
"subtotal": "<string>",
"subtotal_tax": "<string>",
"shipping_total": "<string>",
"shipping_tax": "<string>",
"shipping_taxes": [
123
],
"discount_total": "<string>",
"discount_tax": "<string>",
"cart_contents_total": "<string>",
"cart_contents_tax": "<string>",
"cart_contents_taxes": [
123
],
"fee_total": "<string>",
"fee_tax": "<string>",
"fee_taxes": [
123
],
"total": "<string>",
"total_tax": "<string>"
},
"removed_items": [
{
"key": "<string>",
"product_id": 123,
"quantity": 123,
"name": "<string>"
}
],
"cross_sells": [
{
"id": 123,
"product_name": "<string>",
"product_title": "<string>",
"price": "<string>",
"regular_price": "<string>",
"sale_price": "<string>",
"product_image": "<string>"
}
],
"notices": {},
"extensions": {}
}Unique identifier for the cart item.
^[\w-]{32}$Returns the item details once restored.
Cart item restored successfully.
Complete cart object with enhanced v2 structure.
Unique cart hash.
Unique cart key for the customer.
Show child attributes
Show child attributes
Cart items indexed by item key.
Show child attributes
Total number of items in cart.
Total weight of all items.
Applied coupons.
Show child attributes
Whether the cart needs payment.
Whether the cart needs shipping.
Show child attributes
Cart fees.
Show child attributes
Cart taxes.
Show child attributes
Show child attributes
Recently removed items that can be restored.
Show child attributes
Cross-sell products.
Show child attributes
Cart notices and messages.
Additional data from extensions.
Was this page helpful?