Shop object
Last updated
Was this helpful?
Last updated
Was this helpful?
Important Notice
Shopify is deprecating the Shopify Admin REST API which the Mechanic REST objects depend on. The first round of deprecations involve the product and variant endpoints. Read about the deprecation and . Use the going forward. The and objects will cease to work on on Feb 1, 2025 due to the changes being made by Shopify. Shopify will phase out the REST API completely over time, you can read more about this .
All of our will be ported to use GraphQL only, which will provide a model for how you can update your custom tasks. You'll be able to update your non-customized library tasks with a click of a button Please see these for migrating your custom tasks to GraphQL.
Use {{ shop }}
in any task, at any time
Use caution when loading large sets of resources through the shop object. Using code like {% product in shop.products %}
will result in Mechanic downloading the complete REST representation of all products in the store, which may be more data than is necessary or useful. When working with large amounts of data, consider instead.
For clarity: looking up a single resource by ID will only result in a single REST API call, as in {% assign product = shop.products[1234567890] %}
. If many of these requests are necessary, it may still be useful to look to GraphQL, but this kind of usage does not load more than the specific, single resource identified.
The admin URL of the shop (e.g. https://admin.shopify.com/store/mechanic-shop/)
{{ shop.admin_url }}
An index of
{{ shop.collections[1234567890] }}
{% for collection in shop.collections %}
An index of
{{ shop.products[1234567890] }}
{% for product in shop.products %}
{% for product in shop.products.published %}
An index of
{{ shop.variants[1234567890] }}
{% for variant in shop.variants %}
An index of
{{ shop.orders[1234567890] }}
{% for order in shop.orders %}
{% for order in shop.orders.paid %}
An index of
{{ shop.draft_orders[1234567890] }}
{% for draft_order in shop.draft_orders.invoice_sent %}
An index of
{{ shop.customers[1234567890] }}
{{ shop.customers["jdoe@example.com"] }}
{% for customer in shop.customers %}
An index of
{{ shop.price_rules[1234567890] }}
{% for price_rule in shop.price_rules %}
A lookup of
{{ shop.discount_codes["SUMMERTIME"] }}
An index of
{{ shop.blogs[1234567890] }}
{% for blog in shop.blogs %}
A set of
{{ shop.articles.tags }}
A set of
{{ shop.articles.authors }}
A set of
{% for shipping_zone in shop.shipping_zones %}
The related
{{ shop.metafields }}