End of Day, Void and Refund
There are two ways to undo an approved sale: a void and a refund. Which one applies depends on whether the payment has entered an end of day.
End of day and voids
When a device runs end-of-day, the payments included in it count as settled. A settled payment cannot be voided: the reversal request gets 409 physical_pos.payment.void_after_settlement with details.allowedOperation REFUND. Return the amount with a refund (REFUND) on the same payment. The rule does not depend on the device model.
- You see that a payment is in an end-of-day from the
settledAtfield of the payment object: when it is filled, start a refund instead of a void. The end-of-day number is insettlementBatchNo. → Payments › Payment object - If your void request gets this error, start a refund for the same payment; the refund is a new operation, so use a new
Idempotency-Key. - You read the devices' end-of-day results and their difference from the Lunixi records from the End-of-Day Records endpoint.
Who takes end of day?
| Path | How | Page |
|---|---|---|
| By hand on the device | The cashier takes end of day on the device. | — |
| From the server, on demand | Your server calls POST /devices/{deviceId}/settlement. | Start End of Day |
| From the server, scheduled | Lunixi starts end of day at the time in the policy and retries within the window if needed. | End-of-Day Policy |
| The device's own automatic end of day | The device takes it itself; Lunixi records the result and watches for delays. | End-of-Day Policy |
Whichever path is used, the result reaches End-of-Day Records and the physical_pos.settlement.completed webhook. While end of day is running, the device does not take new payments.
Which one do I use?
settledAt set), a void is not possible. Partial and itemized refunds need the device model's support.| Operation | When | Page |
|---|---|---|
| Void | Before end of day, the whole amount, no reversal on the root yet | Void |
| Refund | After end of day, or when a void is not possible; the whole amount | Refund |
| Partial refund | Part of the amount; several times | Partial Refund |
| Itemized refund | Specific product lines of an itemized sale | Itemized Refund |
| Cancel before start | The payment has not reached the device yet | Cancel Before Start |
End-of-day records
You read the devices' end-of-day results and whether they match Lunixi's records (MATCHED, MISMATCH, UNMAPPED) from the End-of-Day Records endpoint. Which end of day a payment entered is in the payment object's settledAt and settlementBatchNo fields. → The Payment Object