Skip to navigation

Merchant Transactions

Calculate cart tax, record orders, manage exemption certificates, and issue refunds for your merchants.
View as Markdown
Available onStarterProEnterprise

Both merchant types can calculate cart tax and manage exemption certificates. TaxCloud-connected merchants with credentials on file can also record and update orders and issue refunds.

Before you begin

Send your Ziptax API key and the ID of a merchant on your account. Connected cart, order, and refund calls need TaxCloud credentials on file. These calls return 404 (credentials not found) when the credentials are missing.

Common conventions

All Merchant Transactions endpoints share the same shape.

ConventionDetail
MethodPOST for every endpoint, including reads and deletes. Parameters travel in the JSON body, not the URL.
Base URLhttps://api.zip-tax.com
AuthenticationX-API-KEY header only. Unlike the rate-lookup endpoints, these routes do not accept a ?key= query parameter.
Merchant targetEvery request body includes a merchantId (UUID) identifying the merchant to act on.
Content typeapplication/json on any request that sends a body.
EnvironmentCart, order, and refund calls to TaxCloud use the merchant’s Live environment by default. Set the X-ENV: TEST header to use the Test (sandbox) environment instead. See Test vs Live environments.

You never send compliance credentials in the request. Ziptax resolves them server-side from the merchant’s stored TaxCloud credentials, so your integration only ever handles your own Ziptax API key.

Test vs Live environments

Each TaxCloud-connected merchant has two environments: Live (production) and Test (sandbox). By default, cart, order, and refund requests sent to TaxCloud run against Live. To run a request against the merchant’s Test environment instead — for example, to validate your integration without creating real orders or affecting tax filings — set the X-ENV header to TEST.

cURL
curl -X POST "https://api.zip-tax.com/merchant/cart/calculate" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "X-ENV: TEST" \
-H "Content-Type: application/json" \
-d '{
"merchantId": "6b3c1f5e-2a8d-4c9b-9f2e-1d7a4b6c8e10",
"items": [
{
"customerId": "customer-453",
"currency": { "currencyCode": "USD" },
"origin": { "line1": "1 Market St", "city": "San Francisco", "state": "CA", "zip": "94105" },
"destination": { "line1": "200 Spectrum Center Dr", "city": "Irvine", "state": "CA", "zip": "92618" },
"lineItems": [ { "index": 0, "itemId": "sku-1001", "price": 49.99, "quantity": 2 } ]
}
]
}'

X-ENV accepts LIVE (the default) or TEST. Configure the merchant’s TaxCloud Test environment before using it.

Ziptax certificate endpoints use the same certificate store regardless of X-ENV. Use a dedicated test merchant to create or disable test certificates.

Operations

The full set of endpoints, and which merchants each one serves:

OperationMethod & pathSelf-managed merchant
Calculate cart taxPOST /merchant/cart/calculateAvailable
Create order from cartPOST /merchant/order/create-from-cart403
Create orderPOST /merchant/order/create403
Get orderPOST /merchant/order/get403
Update orderPOST /merchant/order/update403
Create exemption certificatePOST /merchant/cert/createAvailable
Get exemption certificatePOST /merchant/cert/getAvailable
List exemption certificatesPOST /merchant/cert/listAvailable
Disable exemption certificatePOST /merchant/cert/deleteAvailable
Create refundPOST /merchant/refund/create403

Ziptax stores new certificates for both merchant types. For order and refund calls, connect the merchant to TaxCloud and store its credentials.

Responses and errors

A successful call returns the requested resource as JSON (a cart calculation, an order, a certificate, or a refund).

See certificate errors for /merchant/cert/* and exemption errors for carts and orders. Other errors fall into two groups.

Ziptax-level errors are returned before the operation runs, when the request can’t be authorized or routed to a valid merchant. They use a simple envelope:

{
"status": "error",
"message": "merchant not found"
}

Operation-level errors are returned when the request reaches the compliance service but fails validation or processing. They carry more structured detail:

{
"status": 422,
"title": "Unprocessable Entity",
"detail": "One or more line items are invalid.",
"error": []
}
HTTP statusWhen it happens
400Malformed JSON, or a missing/invalid merchantId or resource id.
401Missing, invalid, or inactive API key.
403Merchant not found or not owned by your account, or the operation is not available for a self-managed merchant.
404Merchant has no compliance credentials on file.
429Rate limit exceeded (response code 108).
422 and other 4xx/5xxOperation-level validation or processing error (see the structured shape above).
502 / 504The compliance service was unreachable or the request timed out.

Usage and rate limits

Merchant Transactions are metered separately from your tax-lookup (rate request) usage. Each transaction call counts as one merchant request against your plan’s merchant allowance, and every call is subject to per-key rate limiting. Exceeding your rate returns 429 with response code 108, the same as the rest of the API. See Rate Limiting & Errors for backoff guidance.

Every request that passes Ziptax’s up-front checks is metered exactly once, including calls that end in 502/504. Requests rejected up front (bad key, unknown merchant, missing credentials, malformed body, rate limit) do not count against your merchant usage.

Retries and idempotency

Read operations are safe to retry. Write operations are not retried automatically, and you should not blindly retry them either: a retried create can produce a duplicate order, certificate, or refund.

OperationSafe to retry?
order/get, cert/get, cert/listYes, these are reads.
cart/calculateRecalculates; retry only if you did not receive a response.
cert/deleteYes. An already disabled certificate returns the same record.
order/create-from-cart, order/create, order/update, cert/createNo, may duplicate or clobber.
refund/createNo. A duplicate refund is a financial incident.

If a write call times out (504) or the service is briefly unavailable (502), don’t immediately retry. First confirm whether the operation succeeded, for example by fetching the order with order/get, then retry only if it did not.

502 and 504 only arise on the TaxCloud-connected path, where Ziptax calls an upstream service. Cart calculation for a self-managed merchant has no upstream call, so those statuses never appear for it.