Commerce
Shopify
Shopify tips and examples
2 min
explore the following tips and examples to help you manage api limits, avoid errors, and correctly configure the watch events (advanced) module shopify api rate limits the shopify app in make follows shopify’s api credit system to manage how many operations you can perform over time shopify doesn’t limit the number of requests you send, but each request uses credits based on how much data you retrieve or how complex the request is if your available credits run out, shopify blocks new requests with a rate limit error this system helps prevent overload and ensures fair use for all shopify users api limits are set by shopify and depend on your shopify plan your make plan has no impact on these limits how it works? every request you send to shopify uses api credits different types of operations use different amounts of credits actions like creating , updating , or deleting use 10 credits per request for example, when you create an order, 10 credits are deducted from your available pool the same applies to webhooks creating a webhook costs 10 credits, but triggering it later doesn't consume any credits when you request information from shopify using queries, such as get , list , search , or watch , the number of credits depends on how much data you ask for the more complex the query, the higher the cost for more details on how shopify's credit system and graphql query complexity work, see shopify complexity guide for example, in the get an order module, you can control how much information is retrieved by adjusting the available settings you decide how many line items to include in the output (up to 250) and whether to include product variants for each line item, with a limit of up to 250 variants per item the more data you request, the higher the credit usage in this example we set a limit of 250 line items per order we also chose to include product variants, with a limit of 5 variants per line item as a result, if the order has 1 line item, shopify queries 5 variants if the order has 10 line items, then shopify queries 50 variants, which increases the overall credit cost shopify reserves api credits based on the limits you set in make, but only deducts credits for the actual amount of data retrieved for more information, see the quota details section below quota details after running a shopify module in your scenario, you can check the quota details in the output to see how your api credits were used for example, imagine you use the get an order module and set a high limit for line items or variants shopify needs to reserve enough credits to cover the maximum possible result — even if the actual data returned is smaller in the example output above the requested query cost shows 100 credits, meaning shopify reserves that amount based on the potential size of the response you must have at least 100 credits available to even run the request after the query requested, the actual query cost shows 20 credits, based on the real amount of data retrieved — so only 20 credits are deducted from the available limit you’ll also see your current credit status under throttle status in this example, the maximum available credits are set to 2000, which is the highest shopify plan allows after running the request, the currently available credits drop to 1980, reflecting how many credits left the restore rate shows how quickly your credit pool makes space for new requests — similar to how water drains from a bucket to make room for more it is recommended to run your module after setting it up and review the quota details in the output check the requested query cost shown in the output and compare it to your restore rate if your scenario is set to run frequently, or if you manage a large number of scenarios with shopify modules, refining your module mappings is an effective way to reduce your api credit consumption for more details, see shopify api usage limits shopify page size the page size controls how many orders are retrieved per page when using search modules in the shopify app this setting helps prevent issues with shopify's graphql complexity limits, especially when you need to retrieve large amounts of data shopify limits how many items you can request based on the complexity of the query if the request is too large or contains too many fields, it may fail by setting a page size, you can split your request into smaller parts that run one after another, helping you retrieve more orders without exceeding limits to use the page size field, switch on the show advanced settings option example usage let’s say you set the page size to 10 and the order limit to 100 this retrieves 10 pages with 10 orders each, for a total of 100 orders shopify processes these smaller pages one by one, reducing the chance of errors for comparison, if you leave the page size empty and set the order limit to 100, shopify tries to retrieve all 100 orders at once, which might exceed complexity limits and block your request limitations the maximum number of orders per page is 250, based on shopify’s api limits the page size defaults to the lowest value between your mapped order limit and 250 the maximum number of pages that can be retrieved is 31 watch events (advanced) module when using the watch events (advanced) module in the shopify app, you can monitor specific shopify events and include relevant metafields in the output here's how to configure these fields event topic in the event topic field, you need to map which event the module listens to, such as order updates or product changes to find the correct event value refer to the shopify webhook topic enum values documentation enter the copied event topic into the event topic field you successfully configured the event, so the module triggers when this event occurs in your shopify store if you receive a missing scope error while setting up the webhook, edit your connection and add the required scope shown in the shopify documentation metafield namespaces if you want to include metafields in the output, add one or more metafield namespaces to find the namespace log in to your shopify admin account in the left sidebar, click settings > metafields and metaobjects in the metafield definitions section, click on the part of the store you want to use click on the metafield definition you want to use in the namespace and key field, copy the namespace written before the period only for example, if the namespace and key shows custom datafield , you will need to enter custom in the metafield namespace field in the watch events (advanced) module, click +add namespace and enter the namespace copied from your shopify admin account you’ve added the namespace—metafields from this namespace will now be included in the module output if they have assigned values