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
SendPOST /transactions without line_items:
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
- Quote the refunded lines with
POST /calculations. Use the same addresses, tax codes and discounts as on the sale, and settransaction_dateto the sale’stransaction_dateso the same rates apply. Include any refunded shipping as anANCILLARY.SHIPPINGline. Don’t prorate the sale’s tax. - Refund the buyer that tax.
- 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: creditis what marks them as a refund. - Give each credit its own
reference_id, for example-R1,-R2for 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_dateout (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
draftsale is refused with422andcredit_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.
Related
- Transactions management
- Cancellations: before shipping, and sales recorded by mistake.