Order Actions: Remove a line item from an order
The Remove Line Item from Order Action allows you to programmatically remove a specific product variant from an existing order in Shopify. This Action is useful for automating order cleanup, handling exceptions, or updating orders based on business rules.
Configuring the Action
To configure this action, you'll need to specify the variant to remove and optionally include a staff note or choose whether the item should be restocked.
| Field Name | Description | Example |
|---|---|---|
| Variant ID | The Shopify variant ID of the line item to be removed. You can browse and insert variants using the Browse Variants link. | {{ line_items[0].variant_id }} |
| Staff Note | A note explaining why the line item was removed. This note will appear in the order’s timeline. | Removed due to inventory error |
| Restock | If checked, the removed item's quantity will be restocked into the product’s inventory. | true |
Example Configuration
Here is an example of removing the first item from an order if it meets certain conditions:
| Field | Value |
|---|---|
| Variant ID | {{ line_items[0].variant_id }} |
| Staff Note | Removed due to discontinued product |
| Restock | Checked |
Troubleshooting & Usage Tips
Line Item Not Removed: If the line item has been fulfilled it cannot be removed from the order.
Credit Cost
Remove Line Item from Order incurs a cost of one Action Credit on Lite plans and is unlimited on Unlimited plans.
Custom Actions
This Action can be implemented within Custom Actions. Consult the documentation.