---
title: "Calculate cart totals"
method: POST
path: "/cart/calculate"
tags: ["cart-calculate"]
---

# Calculate cart totals

`POST /cart/calculate`

Calculates the cart totals including taxes, shipping, and discounts.

## Request body

- object
  - `return_totals` boolean — Returns the cart totals once calculated.

## Response `200`

Cart totals calculated successfully.

- union
  - CartTotals
    - `subtotal` string — Cart subtotal.
    - `subtotal_tax` string — Cart subtotal tax.
    - `shipping_total` string — Shipping total.
    - `shipping_tax` string — Shipping tax.
    - `shipping_taxes` number[]
    - `discount_total` string — Discount total.
    - `discount_tax` string — Discount tax.
    - `cart_contents_total` string — Cart contents total.
    - `cart_contents_tax` string — Cart contents tax.
    - `cart_contents_taxes` number[]
    - `fee_total` string — Fee total.
    - `fee_tax` string — Fee tax.
    - `fee_taxes` number[]
    - `total` string — Cart total.
    - `total_tax` string — Total tax.
  - CartV2 — Complete cart object with enhanced v2 structure.
    - `cart_hash` string — Unique cart hash.
    - `cart_key` string — Unique cart key for the customer.
    - `currency` Currency
      - `currency_code` string — Currency code.
      - `currency_symbol` string — Currency symbol.
      - `currency_symbol_pos` string — Currency symbol position.
      - `currency_minor_unit` integer — Currency minor unit.
      - `currency_decimal_separator` string — Currency decimal separator.
      - `currency_thousand_separator` string — Currency thousand separator.
      - `currency_prefix` string — Currency prefix.
      - `currency_suffix` string — Currency suffix.
    - `customer` Customer
      - `billing_address` BillingAddress
        - `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` ShippingAddress
        - `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` object — Cart items indexed by item key.
    - `item_count` integer — Total number of items in cart.
    - `items_weight` number — Total weight of all items.
    - `coupons` AppliedCoupon[] — Applied coupons.
      - `coupon` string
      - `label` string
      - `saving` string
      - `saving_html` string
    - `needs_payment` boolean — Whether the cart needs payment.
    - `needs_shipping` boolean — Whether the cart needs shipping.
    - `shipping` Shipping
      - `total_packages` integer — Number of shipping packages.
      - `show_package_details` boolean — Whether to show package details.
      - `has_calculated_shipping` boolean — Whether shipping has been calculated.
      - `packages` object — Shipping packages.
    - `fees` CartFee[] — Cart fees.
      - `name` string
      - `amount` number
      - `taxable` boolean
      - `tax_class` string
      - `total` number
      - `tax` number
    - `taxes` CartTax[] — Cart taxes.
      - `rate_id` integer
      - `label` string
      - `compound` boolean
      - `tax_total` string
      - `shipping_tax_total` string
    - `totals` CartTotals
      - `subtotal` string — Cart subtotal.
      - `subtotal_tax` string — Cart subtotal tax.
      - `shipping_total` string — Shipping total.
      - `shipping_tax` string — Shipping tax.
      - `shipping_taxes` number[]
      - `discount_total` string — Discount total.
      - `discount_tax` string — Discount tax.
      - `cart_contents_total` string — Cart contents total.
      - `cart_contents_tax` string — Cart contents tax.
      - `cart_contents_taxes` number[]
      - `fee_total` string — Fee total.
      - `fee_tax` string — Fee tax.
      - `fee_taxes` number[]
      - `total` string — Cart total.
      - `total_tax` string — Total tax.
    - `removed_items` RemovedItem[] — Recently removed items that can be restored.
      - `key` string
      - `product_id` integer
      - `quantity` integer
      - `name` string
    - `cross_sells` CrossSellItem[] — Cross-sell products.
      - `id` integer
      - `product_name` string
      - `product_title` string
      - `price` string
      - `regular_price` string
      - `sale_price` string
      - `product_image` string
    - `notices` object — Cart notices and messages.
    - `extensions` object — Additional data from extensions.

## Other responses

- `400` — Bad request - invalid parameters.

---

[API](https://skmtc.net/cocartapi/apis/cocart-jwt-authentication.md) · [All operations](https://skmtc.net/cocartapi/apis/cocart-jwt-authentication/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cocartapi/cocart-jwt-authentication/revisions/2031b047ca5f/schema)
