Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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
795 68 114

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.

 


 If this fixed your issue, likes and accepting as a solution are highly appreciated
|  Build an online presence with our custom-built Shopify Theme: EcomifyTheme
|  Check out our reviews: Trustpilot Reviews
|  We are Shopify Partners: EcomGraduates Shopify Partner



SynapseIndia
Shopify Partner
38 6 8

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
1453 239 531

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