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.
On this page
Fields
The Add order line item action contains the following fields.
Field | Description |
---|---|
Product variant | Required. Click the Browse button on this field to select a product variant from your shop.This field also supports a manually entered product variant GID to identify the product to be added to the order. The format for the GID is gid://shopify/ProductVariant/ , followed by the variant ID number.For example, you visit a variant's page in the Shopify admin. The URL in your browser's address bar is https://admin.shopify.com/store/shopname/products/1234567/variants/36485954240671 . The variant ID is 36485954240671 , and the product variant GID is gid://shopify/ProductVariant/36485954240671 . |
Quantity | Required. The amount of product that the workflow adds to an order. The quantity must be greater than zero. This field supports liquid. Any liquid must evaluate to a number or it will result in a runtime error. |
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. |
Triggers
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 have a Get order data action, or any triggers that contain an order, such as:
- Fulfillment created
- Fulfillment event created
- Order canceled
- Order created
- Order fulfilled
- Order risk analyzed
- Order transaction created
- Refund created
- Tender transaction created
Example
In this example workflow, a free item is added to an order when the order's cost is above $10,000.
Limitations
- This action will add a line item without considering inventory. To add a line item only if the product is in stock, include a condition before the action to check the inventory of the variant to be added.
API details
To learn more, review the orderEditAddVariant mutation.