A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hello,
i'm using Shopify API to get all my orders, but i need to only get the ones that don't have a tracking_number.
I tried:
curl -X GET "https://myshop.myshopify.com/admin/api/2022-10/api/orders.json?fulfillment_status=shipped&tracking_number=null" -H "X-Shopify-Access-Token: my_token"
I also tried:
curl -X GET "https://myshop.myshopify.com/admin/api/2022-10/api/orders.json?fulfillment_status=shipped&tracking_number="null"" -H "X-Shopify-Access-Token: my_token"
But i keep getting all the fulfield orders even if they have tracking_number.
Does anyone knows how i can send a null parameter to the API in order just to get the ones that have tracking_number: null?
Thanks
Solved! Go to the solution
This is an accepted solution.
Hi,
Unfortunately, this is not possible using the Shopify REST API as tracking_number is not a filterable field.
However, you can do this if you install the 'API Blazor' app in your Shopify store. This provides an almost identical API to the Shopify REST API and also offers more flexibility and faster access to your data.
In your case, we provide the additional 'has_tracking_number' field that you can use to filter the orders, so your call would look something like:
curl -X GET "https://myshop.apiblazor.com/admin/api/2022-10/api/orders.json?fulfillment_status=shipped&has_tracking_number=false" -H "X-Shopify-Access-Token: my_api_blazor_token"
I hope this is of some help.
Regards,
Wayne
This is an accepted solution.
Hi,
Unfortunately, this is not possible using the Shopify REST API as tracking_number is not a filterable field.
However, you can do this if you install the 'API Blazor' app in your Shopify store. This provides an almost identical API to the Shopify REST API and also offers more flexibility and faster access to your data.
In your case, we provide the additional 'has_tracking_number' field that you can use to filter the orders, so your call would look something like:
curl -X GET "https://myshop.apiblazor.com/admin/api/2022-10/api/orders.json?fulfillment_status=shipped&has_tracking_number=false" -H "X-Shopify-Access-Token: my_api_blazor_token"
I hope this is of some help.
Regards,
Wayne
Hello @wmartin129 ,
Thanks for the information, but Shopify should allow the filtering of other fields without the need of other apps.