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.

Field Description
Product variant GID Required. The product variant GID identifies the product that is 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://my-shop-name.myshopify.com/admin/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.
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 /manual/shopify-admin/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 start with the following triggers:

  • Draft order created
  • Fulfillment created
  • Fulfillment event created
  • Order cancelled
  • Order created
  • Order fulfilled
  • Order paid
  • Order risk analyzed
  • Order transaction created
  • Refund created
  • Tender transaction created

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.

API details

To learn more, review the order​Edit​Add​Variant mutation.

Ready to start selling with Shopify?

Try it free