Documentation is still being updated. Some content maybe unfinished.
curl --request POST \
--url {protocol}://{host}/wp-json/cocart/v2/cart/calculate \
--header 'Content-Type: application/json' \
--data '
{
"return_totals": false
}
'{
"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>"
}curl --request POST \
--url {protocol}://{host}/wp-json/cocart/v2/cart/calculate \
--header 'Content-Type: application/json' \
--data '
{
"return_totals": false
}
'{
"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>"
}Returns the cart totals once calculated.
Cart totals calculated successfully.
Cart totals when return_totals is true.
Cart subtotal.
Cart subtotal tax.
Shipping total.
Shipping tax.
Discount total.
Discount tax.
Cart contents total.
Cart contents tax.
Fee total.
Fee tax.
Cart total.
Total tax.
Was this page helpful?