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

# Calculate cart totals

`POST /calculate`

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

## Request body

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

## Response `200`

Cart totals calculated successfully.

- union
  - string — Success message when return parameter is false or not provided.
  - CalculateResponse
    - `subtotal` string — Cart subtotal (before taxes and shipping).
    - `subtotal_tax` number — Cart subtotal tax amount.
    - `shipping_total` string — Total shipping cost.
    - `shipping_tax` number — Shipping tax amount.
    - `shipping_taxes` object[] — Array of shipping taxes.
    - `discount_total` number — Total discount amount applied.
    - `discount_tax` number — Discount tax amount.
    - `cart_contents_total` string — Total cart contents value.
    - `cart_contents_tax` number — Cart contents tax amount.
    - `cart_contents_taxes` object[] — Array of cart contents taxes.
    - `fee_total` string — Total fees applied.
    - `fee_tax` number — Fee tax amount.
    - `fee_taxes` object[] — Array of fee taxes.
    - `total` string — Cart total amount.
    - `total_tax` number — Total tax amount.

## 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/versions/2031b047ca5f/schema)
