Skip to content

Returns

Preview — not live, shape may changeView as Markdown

When goods come back, tell LoyX which receipt they came from. LoyX finds the original sale by your own receipt id (the external_transaction_id you sent with it) and reverses what that sale earned on the returned lines.

  • Link by your receipt id. The original may be from another store of the same brand.
  • The member comes from the original. You do not have to identify the customer again.
  • Partial and repeated returns work. Each reverses only its own lines, net of their discounts, and never more than the original paid.
  • Never send a negative sale. Send a return instead.
  • A return that arrives before its sale waits. If the original is not in LoyX yet, the return is kept as “awaiting original” and linked when the sale arrives. It is not closed with nothing reversed.
  • Returns without a reference are stored but reverse nothing; the brand can review them.
  • Points are reversed after the return, like earning. Read the card or listen for the event.
  • Used rewards stay used by default. The brand can choose to restore them.
  • A whole-receipt cancellation is a return of every line.
POST /v1/returns
{
"context": { "store": { "external_store_id": "store12" }, "receipt_id": "store12-reg3-000187", "occurred_at": "...", "currency": "SEK" },
"original": { "receipt_id": "store12-reg3-000123" },
"kind": "return",
"lines": [ { "product": { "till_product_id": "SKU-1001" }, "quantity": { "value": 1, "unit": "ea" }, "refund_minor": 4500 } ]
}

The answer says whether the return is linked, awaiting_original or unlinked. The return’s own receipt id is its duplicate key, the same way sales work today.

return.recorded, return.linked and points.reversed. See Webhooks.