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.

Fields

The Add order line item action contains the following fields.

FieldDescription
Product variantRequired. 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.
QuantityRequired. 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 variantsWhen checked, the workflow adds the variant quantity to the order, even if the variant is already part of the order.
Email order updates to customerWhen checked, the workflow notifies the customer of all changes to the order, including additional payments.
Order timeline noteWhen 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:

Example

Example of a workflow that adds line items when an order is created that costs over 10,000

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 order​Edit​Add​Variant mutation.

Can’t find the answers you’re looking for? We’re here to help.