Guide
Transactions and refunds
Store completed sales and create refunds or corrections against the original transaction and calculation lines.
Save a transaction
- Create a calculation with the facts for the transaction, then read its outcome.
- When you need a saved record, create a transaction with the calculation ID and your order or invoice reference.
- Keep the transaction and calculation IDs with your business record.
Transactions store the original amounts. They do not recalculate tax.
Record a refund or correction
Create an adjustment against the transaction. Point each adjustment line to an original calculation line and set either an amount or a quantity. The API reverses the stored tax components and prevents cumulative adjustments from exceeding the original sale.
Request
Shell
curl --request POST \
--url "https://api.salestaxcalculatorapi.com/v1/transactions" \
--header "Authorization: Bearer $SALESTAX_API_KEY"
--header "Content-Type: application/json" \
--header "Idempotency-Key: order-1001-txn" \
--data '{"calculation_id":"calc_01J6A3S8Z6K4M6T2Y2W9M5X8Q0","reference":"order-1001"}'