Add order line item
The Add order line item action adds a product variant to the order that starts the workflow. This action can be used to add a free or paid product variant that you intend to charge for.
The Add order line item action runs after the checkout is complete, so customers only see the line item if they view their order.
The Add order line item action contains the following fields.
|Product variant GID||Required. The product variant GID identifies the product that is added to the order. The format for the GID is
For example, you visit a variant's page in the Shopify admin. The URL in your browser's address bar is
|Quantity||Required. The amount of product that the workflow adds to an order. The quantity must be greater than zero.|
|Allow duplicate variants||When checked, the workflow adds the variant quantity to the order, even if the variant is already part of the order.|
|Email order updates to customer||When checked, the workflow notifies the customer of all changes to the order, including additional payments.|
|Order timeline note||When text is entered, the workflow adds it as a note on the order timeline.|
The Add order line item action has a hidden field added to it by the trigger. This field, Order ID, identifies the order to add lines to. The order ID is set by default and can't be changed.
The Add order line item action can be used in workflows that start with the following triggers:
- Fulfillment created
- Fulfillment event created
- Order cancelled
- Order created
- Order fulfilled
- Order risk analyzed
- Order transaction created
- Refund created
- Tender transaction created
In this example workflow, a free item is added to an order when the order's cost is above $10,000.
To learn more, review the orderEditAddVariant mutation.