Merchant Transactions
Calculate cart tax, record orders, manage exemption certificates, and issue refunds on behalf of your TaxCloud-connected merchants.
Merchant Transactions extend Merchant Management with the day-to-day tax operations your merchants need: calculating tax on a cart, recording and updating orders, storing exemption certificates, and issuing refunds. Every operation runs against a single TaxCloud-connected merchant, so your platform can drive full transaction-level compliance without asking each merchant to integrate separately.
Before you begin
You need two things:
- A Ziptax API key. See Authentication for where to get one and how to send it.
- A TaxCloud-connected merchant with compliance credentials on file.
Create the merchant and store its credentials as described in
TaxCloud-connected merchants. A merchant
without valid credentials returns
404(credentials not found) on every transaction call.
Self-managed merchants (status
external_compliance) have no TaxCloud credentials. Cart calculation still
works for them — Ziptax calculates it directly, as described in
Self-Managed Cart Calculation — but every
other endpoint on this page returns 403 until the merchant is invited to
TaxCloud and connected.
Common conventions
All Merchant Transactions endpoints share the same shape.
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, every request runs 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.
X-ENV accepts LIVE (the default) or TEST, and applies to every Merchant
Transactions endpoint. Omit it to run against Live.
The Test environment is isolated from Live: carts, orders, refunds, and
certificates created with X-ENV: TEST never affect Live data and are never
filed. Make sure the merchant’s Test environment is configured before you use it.
Operations
Calculate tax for a cart of items before you record an order.
Create orders from a cart or directly, then retrieve and update them.
Store, retrieve, list, and delete customer exemption certificates.
Refund all or part of a previously recorded order.
The full set of endpoints, and which merchants each one serves:
Every operation except cart calculation stores state — an order, a certificate,
a refund — which a self-managed merchant has no compliance account to store it
in. Those calls fail fast with 403 rather than returning a misleading
404 credentials not found.
Responses and errors
A successful call returns the requested resource as JSON (a cart calculation, an order, a certificate, or a refund).
Errors come in two shapes:
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:
Operation-level errors are returned when the request reaches the compliance service but fails validation or processing. They carry more structured detail:
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.
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.
Related
Create merchants and choose between the two compliance models.
The one transaction endpoint available to a self-managed merchant.
Connect merchants to TaxCloud and store the credentials these operations depend on.
How to obtain and send your Ziptax API key.
Track your usage against plan quotas.