Documentation is still being updated. Some content maybe unfinished.
curl --request GET \
--url {protocol}://{host}/wp-json/cocart/v1/totals{
"subtotal": "<string>",
"subtotal_tax": 123,
"shipping_total": "<string>",
"shipping_tax": 123,
"shipping_taxes": [
123
],
"discount_total": 123,
"discount_tax": 123,
"cart_contents_total": "<string>",
"cart_contents_tax": 123,
"cart_contents_taxes": [
123
],
"fee_total": "<string>",
"fee_tax": 123,
"fee_taxes": [
123
],
"total": "<string>",
"total_tax": 123
}Retrieves the cart totals including subtotal, taxes, shipping, and discounts.
curl --request GET \
--url {protocol}://{host}/wp-json/cocart/v1/totals{
"subtotal": "<string>",
"subtotal_tax": 123,
"shipping_total": "<string>",
"shipping_tax": 123,
"shipping_taxes": [
123
],
"discount_total": 123,
"discount_tax": 123,
"cart_contents_total": "<string>",
"cart_contents_tax": 123,
"cart_contents_taxes": [
123
],
"fee_total": "<string>",
"fee_tax": 123,
"fee_taxes": [
123
],
"total": "<string>",
"total_tax": 123
}Returns the totals pre-formatted.
Cart totals retrieved successfully.
Subtotal of all items in the cart. Returns formatted price if html=true.
Subtotal tax amount. Returns formatted price if html=true.
Shipping total cost. Returns formatted price if html=true.
Shipping tax amount. Returns formatted price if html=true.
Array of shipping tax rates.
Total discount amount. Returns formatted price if html=true.
Discount tax amount. Returns formatted price if html=true.
Cart contents total. Returns formatted price if html=true.
Cart contents tax. Returns formatted price if html=true.
Array of cart content tax rates.
Fee total amount. Returns formatted price if html=true.
Fee tax amount. Returns formatted price if html=true.
Array of fee tax rates.
Total amount of the cart including tax. Returns formatted price if html=true.
Total tax amount. Returns formatted price if html=true.
Was this page helpful?