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.
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:
This will return the order information along with the list of fulfillments associated with that order.
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
SynapseIndia® - Shopify (2.0 and Plus) Experts
I.T. Outsourcing @ Peace of Mind
Develop and manage Ecommerce stores
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.
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