Created
November 21, 2025 07:37
-
-
Save bherila/7174bab903b6f78239a3fdefbeff9329 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Here’s a recap of the flow you should follow after you commit an order edit using orderEditCommit: | |
| 1. Commit the Order Edit | |
| You already do this with orderEditCommit. | |
| 2. Fetch Fulfillment Orders for the Edited Order | |
| After the edit is committed, fetch the fulfillment orders for the order to see if multiple fulfillment orders exist (which can happen if new items were added and the original fulfillment order was not eligible for modification). | |
| Operation | |
| Open in GraphiQL | |
| Copy | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| query GetFulfillmentOrders { | |
| order(id: "gid://shopify/Order/ORDER_ID") { | |
| fulfillmentOrders(first: 10) { | |
| nodes { | |
| id | |
| status | |
| fulfillAt | |
| assignedLocation { | |
| id | |
| name | |
| } | |
| lineItems(first: 10) { | |
| nodes { | |
| id | |
| totalQuantity | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| Replace "gid://shopify/Order/ORDER_ID" with your order’s ID. | |
| 3. Determine Merge Eligibility | |
| Check that the fulfillment orders: | |
| Have status OPEN | |
| Are assigned to the same location | |
| (If scheduled) Have the same fulfillAt value | |
| Only fulfillment orders meeting these criteria can be merged. | |
| 4. Merge Fulfillment Orders (if eligible) | |
| If you have multiple eligible fulfillment orders, use the fulfillmentOrderMerge mutation to merge them. | |
| Example: | |
| Operation | |
| Open in GraphiQL | |
| Copy | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| mutation MergeFulfillmentOrders { | |
| fulfillmentOrderMerge( | |
| fulfillmentOrderMergeInputs: [ | |
| { | |
| mergeIntents: [ | |
| { | |
| fulfillmentOrderId: "gid://shopify/FulfillmentOrder/1234567890" | |
| fulfillmentOrderLineItems: [ | |
| { id: "gid://shopify/FulfillmentOrderLineItem/111", quantity: 2 } | |
| ] | |
| }, | |
| { | |
| fulfillmentOrderId: "gid://shopify/FulfillmentOrder/0987654321" | |
| fulfillmentOrderLineItems: [ | |
| { id: "gid://shopify/FulfillmentOrderLineItem/222", quantity: 1 } | |
| ] | |
| } | |
| ] | |
| } | |
| ] | |
| ) { | |
| fulfillmentOrderMerges { | |
| fulfillmentOrder { | |
| id | |
| status | |
| assignedLocation { | |
| id | |
| name | |
| } | |
| } | |
| } | |
| userErrors { | |
| field | |
| message | |
| } | |
| } | |
| } | |
| Replace the IDs with your actual fulfillment order and line item IDs. | |
| Summary Flow | |
| Commit the order edit with orderEditCommit. | |
| Fetch fulfillment orders for the order. | |
| Check if multiple fulfillment orders exist and if they are eligible to be merged. | |
| If eligible, merge them using fulfillmentOrderMerge. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment