Edit order
/ admin/ v1/ stores/ {store_id}/ orders/ {order_id}/ edit- orders:write
- Idempotency-Key supported
Change the items of an order: quantities of units not yet shipped, and new items at today's price for the order's address. Kept items keep the price, discount and tax they were sold at; stock follows. An unpaid order's pending payment takes the new total; a paid order's payments stay, and balance_due says what is owed: a refund owed is refunded at once unless refund_now is false, a balance due is collected on delivery when collect says so. Send dry_run: true to see the new totals first. (and orders:refund to refund).
Path parameters
store_idstringrequiredThe store's ID, like
store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.order_idstringrequiredThe order's ID, like
ord_01k8qs5s….
Headers
Idempotency-KeystringSend the same key to retry safely: the first answer is replayed for 24 hours.
shop-api-versionYYYY-MMThe version to answer in. Without it, your app’s pinned version, else the newest.
Body
linesarray of objectsaddarray of objectsItems to add, at today's price for the order's address.
dry_runbooleanOnly compute the new totals.
refund_nowbooleanFor a paid order whose new total is lower: refund the difference now (default).
collectenumFor a paid order whose new total is higher: collect the balance on delivery, or later.
- later
- on_delivery
Returns
200 The edit (saved unless a dry run).
Errors
- 403
forbiddenMissing permission. - 404
not_foundNo such order. - 409Closed or refunded order (
order_not_open,order_refunded), an order left empty (order_empty), not enough stock, no cash on delivery to collect with (no_cash_on_delivery). - 422
validation_failedUnknown lines, shipped units removed, nothing changed.