Use static endpoint URLs
When working with Shopify's API in your hooks, it's crucial to handle API versions correctly.
Shopify regularly updates its API versions and removes an API version every quarter.
When an action references a deprecated API version, it will fail, potentially breaking your application.
To prevent this, Cloudhooks can automatically upgrade your API endpoints—but only if you use static strings for the endpoints in your hook's code.
❌ Avoid using dynamic API versions like this:
✅ Instead, you can omit the API version entirely to automatically use the lowest supported version:
✅ Or, if you need a specific API version, use a static endpoint:
Key Takeaways
- Always use static endpoint URLs in your hooks
- Either omit the API version to use the lowest supported version automatically
- Or specify a fixed API version if needed for specific functionality