Skip to content

Edit order

POST/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_idstringrequired

    The store's ID, like store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.

  • order_idstringrequired

    The order's ID, like ord_01k8qs5s….

Headers

  • Idempotency-Keystring

    Send the same key to retry safely: the first answer is replayed for 24 hours.

  • shop-api-versionYYYY-MM

    The version to answer in. Without it, your app’s pinned version, else the newest.

Body

  • linesarray of objects
  • addarray of objects

    Items to add, at today's price for the order's address.

  • dry_runboolean

    Only compute the new totals.

  • refund_nowboolean

    For a paid order whose new total is lower: refund the difference now (default).

  • collectenum

    For 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

  • 403forbiddenMissing permission.
  • 404not_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).
  • 422validation_failedUnknown lines, shipped units removed, nothing changed.