Add order line item
TheAdd order line itemaction adds aproduct variantto 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.
TheAdd order line itemaction runs after the checkout is complete, so customers only see the line item if they view their order.
Fields
TheAdd order line itemaction contains the following fields.
Field | Description |
---|---|
Product variant GID | Required. The product variant GID identifies the product that is added to the order. The format for the GID isgid://shopify/ProductVariant/ , followed by thevariant ID number.For example, you visit a variant's page in the Shopify admin. The URL in your browser's address bar is https://my-shop-name.myshopify.com/admin/products/1234567/variants/36485954240671 . The variant ID is36485954240671 , and the product variant GID isgid://shopify/ProductVariant/36485954240671 . |
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 theorder timeline. |
Triggers
TheAdd order line itemaction 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.
TheAdd order line itemaction 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
Example
我n this example workflow, a free item is added to an order when the order's cost is above $10,000.
API details
To learn more, review theorderEditAddVariantmutation.