Add list of fulfillments in orders.json API

LeeHM
Shopify Partner
3 0 2

Is it possible to add this piece of information in orders.json API?

Or else, the current flow uses up quite a lot of API call quota as I need to 
1. get order
2. get fulfillment <-- extra call compared to previous fulfillment (before fulfillment API) implementation
3. fulfill the fulfillment

 

If list of fulfillments is embedded in orders.json API, I can skip one API call.

Replies 4 (4)

EcomGraduates
Shopify Partner
588 48 77

hello there  

 

Yes, it is possible to include the list of fulfillments in the orders.json API by using the include parameter in the API call.

To include the list of fulfillments, you can use the following API call:

 

 

GET /admin/api/2021-09/orders/#{order_id}.json?include=fulfillments

 

This will return the order information along with the list of fulfillments associated with that order.

 

SynapseIndia
Shopify Expert
36 6 7

Hello @LeeHM,

 

Greetings from SynapseIndia, and we are glad to help you today.

 

Instead of Admin REST API , use GraphQL API , help doc for the same is https://shopify.dev/docs/api/admin-graphql/2023-01/queries/orders.

You will notice that in GraphQL version of orders api , shopify provide “query” argument wherein further by using the  filter_parameters of  “fulfillment_status” you can get the required result by avoiding an extra call  in comparison to REST ADMIN API version.

 

 

Happy to answer any other queries you may have.

If you find my solution helpful, please do hit Like and Mark as Solution

Best Regards,

Animesh Sharma

SynapseIndia® - Shopify (2.0 and Plus) Experts

https://shopify.synapseindia.com

I.T. Outsourcing @ Peace of Mind

 

Develop and manage Ecommerce stores

- Get connected: Services | Blog | Portfolio | Help Center

 

SynapseIndia® - Shopify (2.0 and Plus) Experts
https://shopify.synapseindia.com
I.T. Outsourcing @ Peace of Mind
Get connected: Services | Blog | Portfolio | | Help Center
LeeHM
Shopify Partner
3 0 2

GraphQL is not suitable for my use. The orders I deal will have 100+ items from time to time, I can get all of the items with REST in one call, but not with GraphQL. I do use GraphQL for mutation however, it is cheaper than REST call.

ShopifyDevSup
Shopify Staff
1321 216 456

Hi LeeHM,

 

The REST order.json resource does already include Fulfillments [doc reference], are you perhaps referring to FulfillmentOrders? FulfillmentOrders are new with the updated fulfillment process and do require a separate call to the [fulfillment_orders.json endpoint] to read as those are not included in order.json.

 

There is not currently a way to include FulfillmentOrders in the reply when querying the REST order.json resource. There's a lot of info in FulfillmentOrders, possibly enough to process the fulfillment without needing to query the order itself in some cases, which would add a lot of bulk to the order.json.

 

There's some great info at the following link about the differences with the updated fulfillment process: https://shopify.dev/docs/apps/fulfillment/migrate

 

Hope you have a great day

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog