Order edits
Changes to an order after it was placed: items added, quantities lowered or removed. Totals, stock and the balance to pay follow.
Endpoints#
- GET
/orders/{order_id}/edits.jsonList an order's edits - GET
/orders/{order_id}/edits/{id}.jsonGet an order edit - POST
/orders/{order_id}/edits.jsonEdit an order
Paths are relative to https://store.weftgrid.com/api/admin/2026-10. The examples read the token from $STORELOOM_TOKEN and ids from variables like $ORDER_ID.
The order edit object#
What the endpoints below return for one order edit, and the payload of the orders/edited webhooks.
{
"id": "cm2edit0001",
"order_id": "cm2ordr0001",
"changes": [
{
"type": "add",
"line_item_id": "cm2line0002",
"title": "Soy candle",
"variant_title": "Cedar",
"quantity": 1,
"price": "24.00",
"total_discount": "0.00",
"restored": false,
"custom": false,
"restocked": null
},
{
"type": "remove",
"line_item_id": "cm2line0001",
"title": "Stoneware mug",
"variant_title": "Oat",
"quantity": 1,
"price": "22.00",
"total_discount": "0.00",
"restored": false,
"custom": false,
"restocked": true
}
],
"total_before": "50.00",
"total_after": "52.00",
"note": "Customer called to swap",
"notify_customer": true,
"author": {
"type": "staff",
"name": "Sam Rivera"
},
"created_at": "2026-10-24T15:04:00.000Z"
}List an order's edits#
/orders/{order_id}/edits.jsonread_ordersEvery change made to the order after it was placed, oldest first: lines added (add, or units put back with restored: true) and units taken off (remove), with the total before and after.
curl "https://store.weftgrid.com/api/admin/2026-10/orders/$ORDER_ID/edits.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"order_edits": [
{
"id": "cm2edit0001",
"order_id": "cm2ordr0001",
"changes": [
{
"type": "add",
"line_item_id": "cm2line0002",
"title": "Soy candle",
"variant_title": "Cedar",
"quantity": 1,
"price": "24.00",
"total_discount": "0.00",
"restored": false,
"custom": false,
"restocked": null
},
{
"type": "remove",
"line_item_id": "cm2line0001",
"title": "Stoneware mug",
"variant_title": "Oat",
"quantity": 1,
"price": "22.00",
"total_discount": "0.00",
"restored": false,
"custom": false,
"restocked": true
}
],
"total_before": "50.00",
"total_after": "52.00",
"note": "Customer called to swap",
"notify_customer": true,
"author": {
"type": "staff",
"name": "Sam Rivera"
},
"created_at": "2026-10-24T15:04:00.000Z"
}
]
}Get an order edit#
/orders/{order_id}/edits/{id}.jsonread_orderscurl "https://store.weftgrid.com/api/admin/2026-10/orders/$ORDER_ID/edits/$EDIT_ID.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN"Example responseShowHide
{
"order_edit": {
"id": "cm2edit0001",
"order_id": "cm2ordr0001",
"changes": [
{
"type": "add",
"line_item_id": "cm2line0002",
"title": "Soy candle",
"variant_title": "Cedar",
"quantity": 1,
"price": "24.00",
"total_discount": "0.00",
"restored": false,
"custom": false,
"restocked": null
},
{
"type": "remove",
"line_item_id": "cm2line0001",
"title": "Stoneware mug",
"variant_title": "Oat",
"quantity": 1,
"price": "22.00",
"total_discount": "0.00",
"restored": false,
"custom": false,
"restocked": true
}
],
"total_before": "50.00",
"total_after": "52.00",
"note": "Customer called to swap",
"notify_customer": true,
"author": {
"type": "staff",
"name": "Sam Rivera"
},
"created_at": "2026-10-24T15:04:00.000Z"
}
}Edit an order#
/orders/{order_id}/edits.jsonwrite_ordersChanges an open order after it was placed, like Edit order in the admin. add lists products, { variant_id, quantity, price?, discount? } (price defaults to the variant's), or custom items, { title, price, quantity, requires_shipping?, taxable?, sku? }; each becomes a new line item. discount is { type: "percentage", value: "10" } or { type: "fixed_amount", value: "2.00" } (off each unit).
change sets line items' quantities, { line_item_id, quantity }. A line can't go below the units that shipped or were refunded, or above its original quantity (add the product again for more). Units an earlier edit removed can be put back, with their share of the discount. Gift cards can't be added or changed, and cancelled orders can't be edited.
Stock follows: removed units go back where they were held unless restock is false (default true), and added units come from the location holding the order's other items. For a variant that stops selling at zero, a 422 says how many are left.
edit.discount (since 7.3, beside add and change) takes money off the whole order after it was placed: { type: "fixed_amount", value: "300.00", title: "Paid in advance" } or { type: "percentage", value: "10", title }. It spreads over the lines already on the order in proportion to what each still costs (gift cards, lines with refunded units and lines added in the same edit take none) and can't be more than they cost; each line's share is a change of type discount with total_discount and discount_title. An edit can be only a discount.
Totals and tax are worked out again with the order's own tax rate; shipping stays as it was. The payment status follows the new total: more than was paid leaves a balance (total_outstanding; financial_status partially_paid or pending), less leaves money to give back with POST /orders/{id}/refunds.json. note is for staff. notify_customer (default false) emails the customer the updated order with a link to pay any balance, unless the store has turned that email off.
Errors name the field, like edit.change.0.quantity. Fires orders/edited and orders/updated (and inventory_levels/update for stock that moved).
{
"edit": {
"add": [
{
"variant_id": "cm2vari0007",
"quantity": 1
},
{
"title": "Gift wrapping",
"price": "4.00",
"quantity": 1,
"requires_shipping": false
}
],
"change": [
{
"line_item_id": "cm2line0001",
"quantity": 1
}
],
"restock": true,
"note": "Customer called to swap",
"notify_customer": true
}
}curl -X POST "https://store.weftgrid.com/api/admin/2026-10/orders/$ORDER_ID/edits.json" \
-H "X-Storeloom-Access-Token: $STORELOOM_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"edit": {
"add": [
{
"variant_id": "cm2vari0007",
"quantity": 1
},
{
"title": "Gift wrapping",
"price": "4.00",
"quantity": 1,
"requires_shipping": false
}
],
"change": [
{
"line_item_id": "cm2line0001",
"quantity": 1
}
],
"restock": true,
"note": "Customer called to swap",
"notify_customer": true
}
}'Example responseShowHide
{
"order_edit": {
"id": "cm2edit0001",
"order_id": "cm2ordr0001",
"changes": [
{
"type": "add",
"line_item_id": "cm2line0002",
"title": "Soy candle",
"variant_title": "Cedar",
"quantity": 1,
"price": "24.00",
"total_discount": "0.00",
"restored": false,
"custom": false,
"restocked": null
},
{
"type": "remove",
"line_item_id": "cm2line0001",
"title": "Stoneware mug",
"variant_title": "Oat",
"quantity": 1,
"price": "22.00",
"total_discount": "0.00",
"restored": false,
"custom": false,
"restocked": true
}
],
"total_before": "50.00",
"total_after": "52.00",
"note": "Customer called to swap",
"notify_customer": true,
"author": {
"type": "staff",
"name": "Sam Rivera"
},
"created_at": "2026-10-24T15:04:00.000Z"
},
"order": {
"id": "cm2ordr0001",
"name": "#1031",
"number": 1031,
"order_number": 1031,
"email": "[email protected]",
"phone": null,
"currency": "USD",
"financial_status": "paid",
"fulfillment_status": null,
"status": "open",
"cancelled_at": null,
"cancel_reason": null,
"closed_at": null,
"source_name": "api",
"payment_gateway_names": [
"manual"
],
"gateway": "manual",
"subtotal_price": "116.00",
"total_discounts": "0.00",
"total_shipping_price": "6.00",
"total_tax": "0.00",
"taxes_included": false,
"total_price": "122.00",
"total_paid": "122.00",
"total_refunded": "0.00",
"total_outstanding": "0.00",
"discount_codes": [],
"shipping_lines": [
{
"title": "Standard shipping",
"price": "6.00"
}
],
"shipping_address": {
"first_name": "Amara",
"last_name": "Okafor",
"name": "Amara Okafor",
"company": null,
"address1": "12 Alder Street",
"address2": null,
"city": "Portland",
"province": "Oregon",
"zip": "97205",
"country": "United States",
"country_code": "US",
"phone": null
},
"customer": {
"id": "cm2cust0001",
"email": "[email protected]",
"first_name": "Amara",
"last_name": "Okafor",
"phone": null
},
"line_items": [
{
"id": "cm2line0001",
"product_id": "cm2prod0001",
"variant_id": "cm2vari0001",
"title": "Linen shirt",
"variant_title": "M / Sand",
"name": "Linen shirt - M / Sand",
"sku": "LINEN-M-SND",
"vendor": "Juniper & Co.",
"quantity": 2,
"current_quantity": 2,
"price": "58.00",
"total_discount": "0.00",
"fulfilled_quantity": 0,
"fulfillable_quantity": 2,
"refunded_quantity": 0,
"removed_quantity": 0,
"requires_shipping": true,
"taxable": true,
"gift_card": false,
"image": "https://storeloom.example/seed/shirt-sand.svg"
}
],
"fulfillments": [],
"refunds": [],
"note": null,
"tags": "marketplace",
"order_status_url": "https://demo.storeloom.example/orders/cm2ordr0001?token=…",
"locale": "en",
"presentment_currency": "USD",
"shop_currency": "USD",
"market_id": "cm2mrkt0001",
"total_price_set": {
"shop_money": {
"amount": "122.00",
"currency_code": "USD"
},
"presentment_money": {
"amount": "122.00",
"currency_code": "USD"
}
},
"delivery_method": "shipping",
"pickup_location_id": null,
"ready_for_pickup_at": null,
"picked_up_at": null,
"pos_shift_id": null,
"edited_at": "2026-10-24T15:04:00.000Z",
"processed_at": "2026-10-23T09:30:00.000Z",
"created_at": "2026-10-23T09:30:00.000Z",
"updated_at": "2026-10-23T09:30:00.000Z"
}
}