Partial Fulfillment in Shopify via GraphQ

In Shopify, a partial order typically refers to either:

  • Creating an order with only a subset of items from a customer’s full cart.

  • More commonly, partially fulfilling an existing order — fulfilling only some line items or quantities.

This guide focuses on partial fulfillment of existing orders using Shopify’s GraphQL API.

Step 1: Retrieve Fulfillment Order Details

To begin, you need to fetch the fulfillment orders that are still open. Use the following GraphQL query in Postman:

{

 “query”: “query GetFulfillmentOrderDetails { fulfillmentOrders(first: 10, query: “status:OPEN”) { edges { node { id status lineItems(first: 10) { edges { node { id quantity } } } } } } }”

}

This query returns:

  • The first 10 open fulfillment orders.
  • Their line items and quantities.
  • The fulfillment order IDs and line item IDs you’ll need for the next step

Step 2: Submit a Partial Fulfillment Request

Once you have the fulfillment order and line item IDs, use the following mutation to fulfill only selected items or quantities

{

 “query”: “mutation PartialFulfillmentWithDifferentQuantities { fulfillmentOrderSubmitFulfillmentRequest(id: “gid://shopify/FulfillmentOrder/1046000782”, fulfillmentOrderLineItems: [{id: “gid://shopify/FulfillmentOrderLineItem/1072503280”, quantity: 2}, {id: “gid://shopify/FulfillmentOrderLineItem/1072503281″, quantity: 1}]) { originalFulfillmentOrder { id status requestStatus } submittedFulfillmentOrder { id status requestStatus } unsubmittedFulfillmentOrder { id status requestStatus } userErrors { field message } } }”

}

This mutation:

  • Submits a fulfillment request for specific quantities of selected line items.
  • Returns the status of the original, submitted, and unsubmitted fulfillment orders.
  • Includes any user errors for troubleshooting.

 Key Notes

  • This process does not create a new order — it modifies fulfillment status on the existing one.
  • You must use fulfillmentOrderLineItem IDs and specify the quantity to fulfill.
  • Always check for userErrors in the response to catch issues like invalid IDs or quantity mismatches.

Leave a comment

Your email address will not be published. Required fields are marked *