Preview before changing
Because there is no sandbox, you check changes in advance with the preview endpoints. They write nothing. They show what the change would do right now.
| Preview | Purpose |
|---|---|
POST /api/orders/preview |
Check a new order |
POST /api/orders/{order_id}/cancel/preview |
Check whether and under which conditions a cancellation works |
POST /api/orders/{order_id}/delivery-address/preview |
Check whether the delivery address can still be changed |
POST /api/orders/{order_id}/items/preview |
Check a variant swap |
All four need only merchant_order:read.
Response
Section titled “Response”Every preview returns fingerprint and confirmed_summary. Two previews of an unchanged order have the same fingerprint. That tells you nothing changed between preview and change.
The REST API does not require a preview first. You can send any change directly.
Errors and state
Section titled “Errors and state”- If the request itself is faulty, the preview answers
422with a code inextra.error, for exampleUNKNOWN_SKUorINVALID_DELIVERY_ADDRESS. The codes are listed in the reference under each operation. - That an order is no longer changeable or cancelable is not an error. It is part of the
200result of the preview.