Cart Tax Calculation
Calculate sales tax for a cart of items on behalf of a TaxCloud-connected merchant.
Calculate the tax due on a cart of items for one of your TaxCloud-connected merchants. Use this before you record an order so you can display an accurate tax total at checkout. The calculation reflects the merchant’s own compliance configuration (registrations, product rules, and exemptions).
This is the merchant-scoped cart calculation at /merchant/cart/calculate.
It is different from the general-purpose /calculate/cart rate-lookup endpoint,
which is not tied to a merchant.
One endpoint, two engines
/merchant/cart/calculate serves both compliance models.
The request body is the same for both, and Ziptax picks the engine from the
merchantId you send — you never branch on merchant type when building a
request.
If you serve both merchant types, read Self-Managed Cart Calculation before you reuse this page’s payloads. Taxability codes mean different things on the two paths, and a TaxCloud shipping code sent for a self-managed merchant is taxed as an ordinary product rather than as freight.
The rest of this page describes the TaxCloud-connected path. A connected
merchant with no valid credentials returns 404 (credentials not found) —
Ziptax does not fall back to its own engine, because the resulting tax would not
match what the merchant’s TaxCloud account files.
Endpoint
Request body
Cart object
Address object
Line item object
Discounts object
For percentage discounts, value is a decimal fraction between 0 and 1
(0.1 = 10% off); for amount discounts it is a fixed currency amount. When
you provide discounts, line-item prices must be pre-discount originals — if
your prices are already discounted, omit the discounts field.
Example
Response
Returns the calculated carts with tax computed per line item.
If you do not receive a response, it is safe to call cart/calculate again:
calculation has no lasting side effect. Do not, however, retry
order or refund writes blindly. See
Retries and idempotency.