Guide
Calculation batches
Submit up to 100 sales tax calculations in a batch, poll its status, and read each item result.
Submit and poll
- Send 1–100 calculation requests to create a batch.
- Save the batch ID and
Locationheader from the202 Acceptedresponse. - Poll the batch while its status is
queuedorprocessing. Wait forRetry-Afterwhen it is present. - Read each item result when the batch finishes.
Use a batch to submit multiple calculations together. For one calculation, send a regular API request.
Request
Shell
curl --request POST \
--url "https://api.salestaxcalculatorapi.com/v1/calculation-batches" \
--header "Authorization: Bearer $SALESTAX_API_KEY"
--header "Content-Type: application/json" \
--header "Idempotency-Key: erp-import-2026-08" \
--data '{"reference":"erp-import-2026-08","calculations":[{"reference":"invoice-1001","transaction_date":"2026-08-29","currency":"CAD","tax_behavior":"exclusive","billing_event":"subscription_start","seller":{"country":"CA","channel_role":"direct_legal_supplier","registrations":[{"country":"CA","state":"ON","type":"gst_hst","effective_from":"2026-01-01"}]},"customer":{"type":"consumer","address":{"country":"CA","state":"ON","postal_code":"M5V 2T6"}},"lines":[{"reference":"subscription","amount":"100.00","quantity":"1","tax_code":"saas"}]}]}'Keep successful items when some fail
A partially_failed batch keeps completed items and their results. Each failed item includes a problem code. Fix those requests and submit them in a new batch.
202 AcceptedJSON
{
"id": "batch_01J6A6X3DWHGCY7G2XXE5MPA2R",
"object": "calculation_batch",
"reference": "erp-import-2026-08",
"status": "queued",
"total_count": 1,
"succeeded_count": 0,
"failed_count": 0,
"items": [
{
"index": 0,
"status": "queued"
}
],
"request_id": "req_01J6A3RZ1HT2K3W2X8R7P1J4C9",
"created_at": "2026-08-29T12:01:00Z"
}