Skip to content

Reorder

Build a fresh admin draft cart from a previous order's items, ready for the admin to finalise on the customer's behalf — the same flow as the Reorder button on the admin order-view screen.

Endpoint

EndpointMethod
/api/admin/orders/{id}/reorderPOST

What it does

This is the same action as the admin Reorder button:

  1. A new draft admin cart is created for the order's customer (separate from the customer's own active cart).
  2. Each item from the order is re-added to that draft cart. Per-item failures are swallowed (best-effort) — the same behaviour the admin panel has.
  3. Returns the new cart ID. The client can then redirect to the admin's order create screen with that cart.

When it refuses

The endpoint enforces the same 3 eligibility checks the admin panel uses. Each failure returns HTTP 422 with the error message in the detail field — different message per failure mode so the client can act on it.

HTTPConditionMessage
422Order was placed as guest (is_guest = 1)Reorder is not supported for guest orders.
422At least one item's product is no longer purchasableOne or more items in this order are no longer available for purchase.
422Admin's role lacks sales.orders.createYou do not have permission to create orders.
422sales.order_settings.reorder.admin config is offReorder by admin is disabled in store settings.

Sample 422 response

json
{
    "type": "/errors/422",
    "title": "Bad Request",
    "status": 422,
    "detail": "Reorder is not supported for guest orders."
}

There is no request body — the order is identified by the URL.

Released under the MIT License.