Order_number GraphQL Admin API

We are currently migrating from the REST Admin API to the GraphQL Admin API.

The documentation points from order_number in REST to number in GraphQL, but that field doesn’t exist.

In GraphQL, it’s the name field.

Order - GraphQL Admin

I don’t think that is correct. The name field also exists in the REST Admin API, and it is not a number, it’s a string which is customizable (usually contains a #, can contain letters, etc). The order_number field is a sequential number which is unique for each order in a given store.

We have also not found a field in GraphQL that directly corresponds to the order_number field in the REST Admin API. In GraphQL, the name field is generated by combining the order_number property with the merchant-defined order prefix and suffix set in the store’s general settings. If the order_number field is not available in GraphQL, a workaround is to use the name field by removing the prefix and suffix.

I understand what you mean, but there are orders generated by apps, for example, where the name does not even contain the order_number. It can be a word, for example. It is fully customizable. Therefore, the solution isn’t viable.

Any other thoughts on this?

I also encountered the same problem when migrating to GraphQL Admin API and couldn’t find orde_number. Did you find a solution in the end

Nope, no solution yet.

Opened another thread here to get Shopify’s attention.

1 Like