How tax engines should handle credit memos and returns

A credit should reverse the tax that was charged, not recalculate it from scratch. When the ERP sends a credit without a link to the original invoice, the engine uses today’s rates, today’s addresses and today’s exemptions, and the credit no longer matches what the customer paid.

By Herb Park, Clarent Technologies

Why credits go wrong

An invoice is calculated once, on its own date, with the customer’s address, exemption status and the rates in force that day. Weeks later a credit comes through. If the engine treats the credit as a new negative sale, it calculates again with whatever is true now. Usually the result is the same. When something has changed in between, the credit returns a different amount of tax than the invoice charged, and the customer, the ledger and the return disagree.

What changedEffect on a recalculated credit
Rate change in the jurisdictionCredit uses the new rate; tax credited differs from tax charged
Customer provided an exemption certificateCredit returns no tax, although tax was charged on the invoice
Ship-to address correctedCredit lands in a different jurisdiction from the invoice
Product mapping or rule changedCredit gets a different taxability or ERP tax code
A recalculated credit returns more tax than the invoice charged A full credit recalculated after a rate change (illustrative amounts). The net amounts mirror each other and the tax does not.
  • Field: Document date; Invoice 90001234: 2026-03-12; Credit 90005678: 2026-07-08
  • Field: Date used for rates; Invoice 90001234: 2026-03-12; Credit 90005678: 2026-07-08
  • Field: Ship-to jurisdiction; Invoice 90001234: Same city and county; Credit 90005678: Same city and county
  • Field: Net amount; Invoice 90001234: 1,000.00; Credit 90005678: -1,000.00
  • Field: Combined rate; Invoice 90001234: 7.00%; Credit 90005678: 7.25%
  • Field: Tax; Invoice 90001234: 70.00; Credit 90005678: -72.50
  • Tax credited differs from tax charged by 2.50
  • (1) The credit arrived with no link to the invoice, so the engine used the credit's own date for rates.
  • (2) The rate in the jurisdiction changed between the two documents.
  • (3) The customer paid 70.00 and is credited 72.50. The ledger and the return now carry the 2.50.

What good looks like

The original invoice reference and date are what make a credit a reversal The same credit sent two ways (illustrative; field names vary by engine). The three populated fields on the right are what let the engine reverse the original tax.
  • Sent as a new negative sale: <Invoice number="90005678"> <Type>CREDIT</Type> <InvoiceDate>2026-07-08</InvoiceDate> <OrigInvoice/> <OrigDate/> <TaxDate/> <Line id="10"> <Amount>-1000.00</Amount> </Line> </Invoice>
  • Linked to its invoice: <Invoice number="90005678"> <Type>CREDIT</Type> <InvoiceDate>2026-07-08</InvoiceDate> <OrigInvoice>90001234</OrigInvoice> <OrigDate>2026-03-12</OrigDate> <TaxDate>2026-03-12</TaxDate> <Line id="10"> <Amount>-1000.00</Amount> </Line> </Invoice>
  • (1) Empty reference and date fields leave the engine with today's rates, addresses and exemptions.
  • (2) The original invoice number and date let the engine find the transaction it is reversing.
  • (3) A separate tax date tells the engine which day's rates to use.

Not all credits are the same

Credit typeWhat it representsWhat to check
Return of goodsThe sale is partly or fully undoneOriginal date and addresses; quantity matches the return
Price adjustmentThe price was too high; goods were not returnedTax credited is proportional to the price reduction
Rebate or discount after the saleA later reduction, sometimes not tied to one invoiceWhether the jurisdiction allows tax to be reduced at all
Cancel and rebillAn invoice reversed and reissuedThe reversal mirrors the original exactly; the rebill is a fresh calculation

Some ERP document types send the credit as a positive amount with a credit flag, others as a negative amount. Both work if the connector is consistent. Mixing them can produce a "credit" that adds tax.

Troubleshooting a credit that does not match

  1. Pull both calls. Get the request and response for the original invoice and for the credit.
  2. Compare dates. Is the credit using the invoice date or today’s date for rates? Is the original invoice reference populated?
  3. Compare parties and addresses. Look for a changed ship-to, a new exemption, or a different customer number on the credit.
  4. Compare signs and types. Check that the transaction type and the sign of the amounts are what the engine expects for a credit.
  5. Fix the call, not the result. Correct the mapping so future credits carry the original reference and date, then reissue the affected credits.
Three comparisons between the two calls find most credits that do not match Work down the three comparisons in order. Each one that fails points to a cause in the call, and the fix is the same: correct the mapping and reissue.
  • Credit tax differs
  • Pull both calls: Request and response, invoice and credit
  • Original ref and date sent?
  • Same parties and addresses?
  • Sign and type as expected?
  • Rates use today's date: No link back to the invoice
  • Data changed since invoice: Ship-to, exemption or customer number
  • Credit adds tax: Credit flag and negative amounts mixed
  • Fix the mapping, reissue: Correct the call for future credits

What to put in the regression pack