Skip to main content

Using Shopify Variables in Stack

Enhance your e-commerce automation by integrating Shopify variables within Stack. These variables allow you to dynamically insert Shopify order and customer details into your workflows, making your processes more efficient and personalized.

Understanding Shopify Variables

Shopify variables in Stack are placeholders that you can use to automatically pull specific data from Shopify orders. Below is a comprehensive guide on how to use these variables effectively.

Shopify Variable Format

Shopify variables are formatted using double curly braces. For example, to access the order ID, you would use {{order.id}}.

Data Samples and Triggers

Variables can be used with different triggers, such as when a checkout is abandoned or an order is placed. Here’s a breakdown of available variables and their usage:

Order Information

  • Order ID: {{order.id}}
    Example: 1900968798308
    Available for: Abandoned Checkout, Order Placed

  • Order Number: {{order.number}}
    Example: 1044
    Available for: Order Placed

  • Order Status URL: {{order.order_status_url}}
    Example: [link to order]
    Available for: Order Placed

  • Abandoned Checkout URL: {{order.abandoned_checkout_url}}
    Example: [link to abandoned checkout]
    Available for: Abandoned Checkout

  • Created At: {{order.created_at}}
    Example: 2021-10-21T11:47:12+05:30
    Available for: Abandoned Checkout, Order Placed

  • Created On: {{order.created_on}}
    Example: 10-20-2021
    Available for: Abandoned Checkout, Order Placed

  • Currency: {{order.currency}}
    Example: $
    Available for: Abandoned Checkout, Order Placed

  • Currency Code: {{order.currency_code}}
    Example: USD
    Available for: Abandoned Checkout, Order Placed

Customer Information

  • First Name: {{order.customer.first_name}}
    Example: John
    Available for: Abandoned Checkout, Order Placed

  • Last Name: {{order.customer.last_name}}
    Example: Carter
    Available for: Abandoned Checkout, Order Placed

  • Email: {{order.customer.email}}
    Example: johncarter@gmail.com
    Available for: Abandoned Checkout, Order Placed

  • Phone: {{order.customer.phone}}
    Example: 18989898989
    Available for: Abandoned Checkout, Order Placed

Order Value

  • Total Cart Price: {{order.total_cart_price}}
    Example: 99.00
    Available for: Order Placed

  • Discount Code: {{order.discount_code}}
    Example: TESTDISC20
    Available for: Order Placed

  • Total Discount Value: {{order.total_discounts}}
    Example: 11.99
    Available for: Order Placed

  • Order Has Discount?: {{order.has_discount}}
    Example: true/false
    Available for: Order Placed

  • Subtotal Price: {{order.subtotal_price}}
    Example: 88.99
    Available for: Order Placed

  • Total Shipping Price: {{order.total_shipping_price}}
    Example: 14.49
    Available for: Order Placed

  • Total Price: {{order.total_price}}
    Example: 102.99
    Available for: Order Placed

Customer Billing Address

  • Contact Name: {{order.billing_address.name}}
    Example: John Carter
    Available for: Order Placed

  • Company: {{order.billing_address.company}}
    Example: Marvel Inc.
    Available for: Order Placed

  • Address 1: {{order.billing_address.address1}}
    Example: 890
    Available for: Order Placed

  • Address 2: {{order.billing_address.address2}}
    Example: Fifth Avenue, Manhattan
    Available for: Order Placed

  • Province: {{order.billing_address.province}}
    Example: New York City
    Available for: Order Placed

  • Zip Code: {{order.billing_address.zip}}
    Example: 10128
    Available for: Order Placed

  • Country: {{order.billing_address.country}}
    Example: United States
    Available for: Order Placed

Customer Shipping Address

  • Contact Name: {{order.shipping_address.name}}
    Example: John Carter
    Available for: Order Placed

  • Company: {{order.shipping_address.company}}
    Example: Marvel Inc.
    Available for: Order Placed

  • Address 1: {{order.shipping_address.address1}}
    Example: 890
    Available for: Order Placed

  • Address 2: {{order.shipping_address.address2}}
    Example: Fifth Avenue, Manhattan
    Available for: Order Placed

  • Province: {{order.shipping_address.province}}
    Example: New York City
    Available for: Order Placed

  • Zip Code: {{order.shipping_address.zip}}
    Example: 10128
    Available for: Order Placed

  • Country: {{order.shipping_address.country}}
    Example: United States
    Available for: Order Placed

  • Order Requires Shipping?: {{order.requires_shipping}}
    Example: true/false
    Available for: Order Placed

Advanced Variables

Order/Abandoned Cart Items

Coming Soon: Use the following format to access item details:

`{{#each Order line_items as | item |}}`
- **Item ID**: ``{{item.id}}``
- **Image**: ``{{item.image}}``
- **Title**: ``{{item.title}}``
- **Quantity**: ``{{item.quantity}}``
- **Price**: ``{{item.price}}``
- **Line Price**: ``{{item.line_price}}``
`{{/each}}`

Order Tax Details

Coming Soon: Use the following format to access tax details:

`{{#each Order tax_lines as | tax |}}`
- **Tax Title**: ``{{tax.title}}``
- **Rate**: ``{{tax.rate}}``
- **Price**: ``{{tax.price}}``
`{{/each}}`

By leveraging these variables, you can automate and personalize your communications with customers, ensuring they receive the most relevant information regarding their orders.