Covers all questions related to inventory management, order fulfillment, and shipping.
We allow our fulfillment center to substitute out-of-stock products with similar products. Substituting product is not a variant of the ordered product. Without changing the original order, how can we link the substituting item as fulfilling the original item? This should, ideally, reduce the inventory of the substituting item and not the substituted item.
At https://shopify.dev/docs/api/admin-graphql/2024-01/objects/FulfillmentLineItem, we don't see a way to specify the substituting item, but only a way to specify the the line item which is being fulfilled.
Are you sure you don't want to edit the original order? That actually seems like the most straight forward approach here and you could automate it.
It should still show the removed original product on the order btw which is a good paper trail.
Business Scenario
When customer orders Product A ( its not in stock ) you want to give productB ( call it substitute ) without the customer knowing.