Skip to main content
A refund, return or cancellation after an order has shipped is a new transaction with type: credit, linked to the original sale with parent_transaction_id. Don’t update the original sale: once it is finalized, its line items can’t be changed. This also covers chargebacks, recalls and items found missing after delivery: each is a credit for the affected lines.

Full refund

Send POST /transactions without line_items:
Taxwire copies the sale’s line items and discounts onto the credit. Leave line_items out entirely: an empty list ([]) copies nothing. Send the tax you refunded as tax_amount. If the sale was recorded with a tax_amount, the credit doesn’t copy it, so the credit needs its own.

Partial refund

  1. Quote the refunded lines with POST /calculations. Use the same addresses, tax codes and discounts as on the sale, and set transaction_date to the sale’s transaction_date so the same rates apply. Include any refunded shipping as an ANCILLARY.SHIPPING line. Don’t prorate the sale’s tax.
  2. Refund the buyer that tax.
  3. Record the credit with only the refunded lines. Returning one of the two hoodies from the checkout example:

Rules for every credit

  • Amounts are positive. type: credit is what marks them as a refund.
  • Give each credit its own reference_id, for example -R1, -R2 for successive refunds on one order.
  • Send the tax you refunded as tax_amount. It is the amount Taxwire reports.
  • Date the credit when the refund happens. Leave transaction_date out (it defaults to now) or send the refund’s date. A credit is reported in the period of its own date, so a refund in a later quarter reduces that quarter’s return. Don’t date a credit before its sale: Taxwire flags it with a warning.
  • Link credits to a finalized sale. A credit against a draft sale is refused with 422 and credit_remainder_unknown. See the FAQ.
  • Use the sale’s currency. A credit with line items in another currency is refused with 422. A full refund always takes the sale’s currency.
  • Keep refunds within the sale. Taxwire doesn’t stop credits from adding up to more than the sale, so your system needs to.