Get FulfillmentOrders with Order object?

Is it possible to get the FulfillmentOrder(s) for a given order in an array on /orders/:order_id.json

Or does the retrieval of Order and the associated FulfillmentOrders need to be two separate calls?

Hi @iancos :waving_hand:

The order details would need to be fetched at the /orders/{ORDER_ID}.json endpoint, and a secondary request would be needed to retrieve a list of fulfillment orders for that order ID using the /orders/{ORDER_ID}/fulfillment_orders.json endpoint.

Alternatively, you can fetch both with a single request using GraphQL:

{
    order (id: "gid://shopify/Order/1234") {
        customer { id }
        fulfillmentOrders (first:10) {
            nodes {
                id
            }
        }
    }
}

Hope that helps!

1 Like

What if I am starting from fulfillmentOrders and I want to filter by a specific order id?

Hi @cblackdescartes ,

Unfortunately the fulfillmentOrders query doesn’t allow you to filter by order id specifically. However while you can’t filter by order id, you can query the orderId field on the fulfillmentOrder object to see what Order the resulting Fulfillment Orders are attached to.

{> fulfillmentOrders(first: 10){> edges{> node{> id> orderId> }> }> }> }- fulfillmentOrders - GraphQL Query with available filters

I hope this helps, and I hope you have a great day :slightly_smiling_face: