@Jacob_D @cowboybob @HunkyBill
So i found a solution to split orders. It is a (little bit of a) crazy hack and can be dangerous if something goes wrong.
If you (pseudo-)fulfill part of the order, you can then move the rest of the order to a new location. You can then cancel the fullfillment and you have successfully split the order into two locations. This way also works manually and with graphql. Here is my code:
First the code for partially fulfilling an order. As you can see notifyCustomer is false, so that the customer doesn’t get alerted for the changes, that we are making.
mutation fulfillmentCreateV2 {
fulfillmentCreateV2(fulfillment: {
notifyCustomer: false,
lineItemsByFulfillmentOrder: [
{
fulfillmentOrderId: "gid://shopify/FulfillmentOrder/23423423423",
fulfillmentOrderLineItems: {
id: "gid://shopify/FulfillmentOrderLineItem/234242342342",
quantity: 3
}
}
{
fulfillmentOrderId: "gid://shopify/FulfillmentOrder/23423423423",
fulfillmentOrderLineItems: {
id: "gid://shopify/FulfillmentOrderLineItem/234242342343",
quantity: 1
}
}
]
})
{
fulfillment {
id
status
trackingInfo {
company
number
url
}
}
userErrors {
field
message
}
}
}
As an output, you get the id for the fulfillment that you need to keep for the last part of the code.
Secondly, you move the unfulfilled part of the fulfillment order to another location.
mutation fulfillmentOrderMove {
fulfillmentOrderMove(id: "gid://shopify/FulfillmentOrder/23423423423"
, newLocationId: "gid://shopify/Location/234234234" ) {
movedFulfillmentOrder {id}
originalFulfillmentOrder {id}
remainingFulfillmentOrder{id}
userErrors {
field
message
}
}
}
As last point, you now cancel the fulfillment. You get the right fulfillment id from the first code:
mutation fulfillmentCancel {
fulfillmentCancel(id: "gid://shopify/Fulfillment/23424234") {
fulfillment {
id
status
}
userErrors {
field
message
}
}
}
The order is now split into two locations.
I hope that will help some of you