This endpoint restores canceled Item Quantities on an Order: the reverse of Cancel Items. The restored quantity becomes open again on the same Order Item, ready to ship and invoice.
Upon successful completion, a comment is added to the Order with each restored quantity, how much was taken out of stock, and the reason. This comment is not visible to the customer who placed the Order.
Only canceled quantities can be restored: qty_to_restore cannot be greater than the item's canceled quantity.
Canceled Items cannot be restored for Orders in the canceled, closed or payment_review state. A complete Order goes back to processing after a restore.
Bundle products and gift cards cannot be restored.
| Param | Type | Notes | Required |
|---|---|---|---|
| order_id | integer | The internal ID of the Order object. Note that this is not the customer facing Order Number. | Yes |
| reason | string | The reason why the items are being restored. This will be included in the Order comment. | Yes |
| deduct_from_stock | boolean | Leave out to match the cancellation: the quantity the cancellation returned to stock is taken back out (for items canceled before this was tracked, the store's Return Qty to Stock When Order is Canceled setting decides). true takes every restored unit out of stock; false leaves stock unchanged. When units are taken out of stock and a product doesn't have enough (and doesn't allow backorders), nothing is restored. | No |
| items | Array of Item | Yes |
Item
| Param | Type | Notes | Required |
|---|---|---|---|
| item_id | integer | The unique ID for this Order Item. This value can be found in the item_id field when retrieving an Order with the API. Use the parent item for a configurable product. | Yes |
| qty_to_restore | float | The quantity to restore. Note that this cannot be greater than the item's canceled quantity. | Yes |
Error codes (in the error message)
| Code | Description |
|---|---|
| SORCI-E-001 | The Order is canceled, closed or in payment review. |
| SORCI-E-002 | No item with a quantity above 0 was provided. |
| SORCI-E-003 | Invalid quantity: item not found on the Order, a child item, or more than its canceled quantity. |
| SORCI-E-004 | Bundle or gift card item. |
| SORCI-E-005 | No reason provided. |
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
