We migrated from Magento to Shopify with all the metafield values and we have been trying to integrate an ERP system with Shopify and we had a lot of issue regarding collecting products with metafield values (ERP ID).
Reading a lot of forum discussions we have stumbled upon a solution where:
- You can filter a product by it’s metafield value through a collection
- We created a collection which contains all the products
- Extending the API to be able to filter products with ERP ID
- Products which had the ERP ID metafield value from the migration are able to be collected
- New products which are being created and put the value of the ERP ID manually or through the API are not able to be collected with this method
Questions:
- Is there any other way for the products to be collected by their metafield value?
- Why the above method is not working? Migrated products with the ERP ID metafield value can be collected, when trying to collect a new product the response is null.
We found an example for collecting products with their metafield value but it does not work:
https://{{api_key}}:{{api_password}}@{{store_name}}.myshopify.com/admin/api/{{api_version}}/products.json?metafields.namespace=magento&metafields.key=ceid&metafields.value=123
Hope someone has a solution to this because Shopify API is really confusing for such simple tasks.