Overview
Refund logic shouldn’t be complicated. This guide covers how to handle the various scenarios you may encounter when issuing returns, credit memos, and whole or partial refunds. Reporting sales creates liability for businesses to taxable jurisdictions, while refund reporting reduces that liability. Accurate refund handling ensures businesses don’t overpay taxes.Endpoints Used
Refund and Sale Transaction Relationships
When creating a refund transaction, the original sale transaction must already exist in Zamp. The sale’s originalid becomes the refund’s parentId, signaling a refund relationship.
You can name refund transactions flexibly — prepend with identifiers like CM-* for credit memos or REF-* for refunds. Multiple refunds for a single sale can use incremented suffixes (e.g., REF-*-01, REF-*-02).
The parentId Property
Handling Refund Transaction Dates
Set the refund’stransactedAt to the date the refund is created. This reduces liability in the current filing period.
Calculating Sales Tax for Refunds
Whole-Transaction Refunds
For complete refunds, calculation calls aren’t always necessary, though integrations with ERP or accounting systems should consider calling/calculations.
Partial-Transaction Refunds
These occur when:- One or more line item quantities decrease below original amounts
- Some line items are canceled entirely (but not all)
- Discounts are applied after the original transaction was reported
- Shipping or Handling were unintentionally charged
- Credits are issued to customers
- Issue a
GETrequest to retrieve the original transaction - Subtract
taxCollectedfromtotal - Retain the
taxCollectedamount but remove that property from the response - Modify line items, discounts, or quantities as needed; recalculate the
total POSTthe transformed data to/calculations- Subtract the calculation response’s
taxDuefrom the retainedtaxCollected
Reporting Refund Transactions
Refund transactions use the same endpoints as sales transactions with three key differences:- Accurate identifiers — unique
id,name, andparentId - Correct date —
transactedAtshould reflect the refund date, not the sale date - Negative values — convert all positive floating-point numbers to negative
Sale Transaction Example
Refund Transaction Example
Non-Item Refunds
For refunds where the line item quantities or amounts were not impacted, they will still need to be included in the calculation and posting request to Zamp.Shipping-Only Refund
Invalid Request
The below is an example of a request that is invalid, for a shipping-only Refund.
Correct Request
Tax-Only Refunds
In a scenario where only tax is refunded to a customer, but the order is not, it is recommended your integration recalculates tax to account for the reason why tax refund is initiated. The below outlines a few scenarios that could result in a taxable order into a non-taxable one:
For questions or issues, contact support@zamp.com.