Searching for an Order by Tracking Number in Shopify GraphQL API

Topic summary

A developer is attempting to query Shopify’s GraphQL API to find an order using a tracking number but encounters an error indicating that fulfillment_tracking_numbers is not a valid search field.

The Problem:

  • The query orders(first: 1, query: "fulfillment_tracking_numbers:'some tracking number'") returns an “Invalid search field” error
  • Direct filtering by tracking number appears unsupported in the orders query

Questions Raised:

  • Whether alternative methods exist to search orders by tracking number
  • If a different field supports tracking number filtering
  • Whether retrieving all orders and manually filtering is the only option
  • If anyone has found a more efficient approach

Suggested Solution:
One respondent proposes retrieving the fulfillment object first (since the tracking number is associated with fulfillments), then accessing the related order from that fulfillment object.

Status: The discussion remains open with one potential workaround suggested but not yet confirmed as effective.

Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

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! :slightly_smiling_face:

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?