Exchanges
Exchanges of paid orders, and the quote that prices an exchange first. Creating an exchange needs the acting user to have an open shift at the outlet.
📄️ Quote an exchange
Prices an exchange: lines taken back and replacement lines sold. Nothing is recorded and the answer is not binding.
📄️ List exchanges
The exchanges recorded at the outlet in `X-Outlet-ID`, newest first, including those made in the cashier app. Pages are keyset-based.
📄️ Create an exchange
Takes lines back and sells replacement lines in one step. A new exchange answers `201`; a retry with the same `Idempotency-Key` answers `201` with the same record.
📄️ Get an exchange
One exchange by its `id`, with the same body as the answer of `POST /exchanges`. `lines` come ordered by leg (the replacement leg first). An exchange made in the cashier app can be read too. An unknown `id`, one that is not a UUID, and the `id` of an exchange at another outlet all answer `404 NOT_FOUND`.