Searching for an Order by Tracking Number in Shopify GraphQL API

Searching for an Order by Tracking Number in Shopify GraphQL API

petza
Tourist
6 0 1

I'm trying to retrieve an order using a tracking number via Shopify's GraphQL API, but I'm running into an issue.

I attempted the following query:

{ orders(first: 1, query: "fulfillment_tracking_numbers:'some tracking number'") { edges { node { id name fulfillments { trackingInfo { number company } } } } } }
 

However, I'm receiving this error:

{"field":"fulfillment_tracking_numbers","message":"Invalid search field for this query."}
 

It seems that fulfillment_tracking_numbers is not a valid search field in Shopify's GraphQL API.

My questions:

  1. Is there another way to search for an order by tracking number using the Shopify GraphQL API?
  2. Is there a different field that allows filtering by tracking number?
  3. Is the only option to retrieve all orders and filter for the tracking number manually?
  4. Has anyone successfully implemented a smarter approach for this?

I’d really appreciate any help or insights!
Thanks in advance! 🙂 

Reply 1 (1)

FrankyGiap
Shopify Partner
88 15 12

Hi @petza

 

Because you you have data about fulfillment tracking number, so how about if you retrive fulfillment first, after that from fulfillment retrive order object?

- Solved it? Hit Like and Accept solution or ❤️Buy Me Coffee❤️
- Fusion Workflow: Automate Your Store with Precision and Ease