⚠️Liquid objects

Mechanic-flavored Liquid comes with a complement of Liquid objects, each of which is tied to a resource in the Shopify Admin REST API. Many objects support access to related objects via lookups (e.g. {{ shop.customers[customer_id].orders.first }}); in this way, the REST API can be traversed by resource.

Access to these Liquid objects varies, based on the context in which Liquid is rendered. For example, a task that subscribes to shopify/customers/create will have access to the Customer object in its code, via a variable called customer. To learn more about how these objects are made available to task code, see environment variables.

Usage

Each task is given a set of environment variables to work with, out of the box. Mechanic's task code editor will tell you which ones are available. For example, for a task responding to a shopify/orders/ event, you might see this:

The cache, event, options, and shop objects are always available for tasks; the order object (as in this example) contains the order to which the current event relates.

Last updated

Was this helpful?