Quote a return
POST/returns/quote
Prices a proposed return of lines of a paid order at the outlet in X-Outlet-ID, and shows which tenders can be refunded. Nothing is recorded and the answer is not binding.
Before you call
- The company needs a plan with returns.
- With
X-User-ID, the acting user needs the return permission and an open shift. - Without
X-User-ID(MPOS-2389): you may quote a return of your own partner order with no acting user and no open shift. The call then runs as your order source, the same actor asPOST /orderswithout a user. All of these must hold:- the order was created by your application's order source with
POST /orders; - every
refund_tendersrow names your source's partner rail: thepayment_method_idof the order's tender on that rail. Never cash, never another payment method; - the outlet needs no approval for returns.
- Without
refund_tenders, every tender of the order must be on that rail (the refund defaults to the original tenders).
- the order was created by your application's order source with
- Anything else without
X-User-IDanswers400 USER_ID_REQUIRED. Exchanges always needX-User-IDand an open shift. - This call takes no
Idempotency-Key. - An order of a kitchen sales type (
dine_in,takeaway,pickup,delivery,qr_ordering) can be returned, refunded or exchanged only once its kitchen ticket is served or completed (kitchen_statusonGET /orders/{id}isservedorcompleted). Other sales types and the replacement order of an exchange are not affected.
Request
refund_tendersis optional on a quote. When sent, each tender must name a refundable tender ofeligible_refund_tenders.- On a partner order, a cash tender above the cash the order was paid with answers
422 PARTNER_REFUND_ORIGINAL_TENDERon the quote already. On a Dine In round, a tender above what its table settlement tender can still take answers422 REFUND_TENDER_EXCEEDS_REMAININGon the quote already. - The other amount checks run when the return is created: an amount that is not above 0, the same payment method twice, more than one tender when the refund is not a full refund of an untouched order, and amounts that do not add up to the refund.
Behaviour
- A tender recorded without a payment method shows
payment_method_id: null,refundable: falseandreason: legacy_tender, and is never insuggested_refund_tenders. - A partner order (one created with
POST /orders) is refunded to the original tender. On it, the Cash group showsrefundable: falseandreason: partner_original_tenderunless the order was paid in cash; when it was, Cash is refundable up to the cash the order paid. A quote that sends a cash tender above that answers422 PARTNER_REFUND_ORIGINAL_TENDER, asPOST /returnsdoes. - A Dine In table bill is several orders, one per round: return, refund or exchange one round at a time. Reverse the rounds a table settlement paid instead of the settlement itself.
- A Dine In round paid through a table settlement lists its share of the settlement's tenders in
eligible_refund_tenders.
Errors
| Status | Code | When |
|---|---|---|
| 400 | VALIDATION_FAILED | The body is not valid. A line that is not part of the order has a field error on lines[i].order_line_id with code NOT_FOUND (INVALID_FORMAT when the order_line_id is not a UUID). |
| 400 | USER_ID_REQUIRED | X-User-ID is missing, and the call is not your own partner order refunded to your rail with no approval (see Before you call). |
| 403 | PLAN_FEATURE_REQUIRED | The plan has no returns. data.reason is not_in_plan or disabled (the merchant can turn it on in Settings > Features), and data.feature is the feature key. A missing Public API add-on answers the same code without data. |
| 403 | PERMISSION_DENIED | The acting user may not do this. |
| 403 | OUTLET_FORBIDDEN | The outlet is not allowed. |
| 404 | NOT_FOUND | Unknown original order, or an order of another outlet. |
| 409 | SHIFT_NOT_OPEN | You sent X-User-ID and the user has no open shift. |
| 409 | DINE_IN_ROUND_UNPAID | The Dine In round's bill is not paid yet. |
| 409 | SETTLEMENT_SALE_NOT_REVERSIBLE | The order is the payment record of a whole table (dine-in or online settlement). |
| 409 | KITCHEN_NOT_FULFILLED | The kitchen ticket is not served or completed, or there is no ticket; see data.kitchen_status (null when there is no ticket). |
| 422 | UNPROCESSABLE | A business rule failed, for example a terms payment order that is not settled. |
| 422 | POST_SALE_DISABLED | The merchant turned this operation off in the post-sale policy. |
| 422 | POST_SALE_WINDOW_EXPIRED | The order is older than the policy allows; data.max_days is the limit in days. |
| 422 | INVALID_USER | The acting user is not valid. |
| 422 | REFUND_TENDER_NOT_ELIGIBLE | A sent tender is not a refundable tender of eligible_refund_tenders. |
| 422 | REFUND_TENDER_EXCEEDS_REMAINING | A Dine In round asks more of one non-cash tender than it can still take. |
| 422 | PARTNER_REFUND_ORIGINAL_TENDER | A partner order: a sent cash tender is above the cash the order was paid with. |
Request
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 422
The return quote
Error envelope
Error envelope
Error envelope
Error envelope
Error envelope
Error envelope