I am using the REST API resources to integrate into a Shopify store. There is a rule that requires some Shopify orders to be split into multiple target resources, which in turn would need to fulfill the Shopify order partially once the split target order is marked as fulfilled.
When retrieving the fulfillment order for this order, the supported_actions field state that it can be split, so the assumption is that we need to use the Fulfillment resource to action the partial fulfillment. One order can be fulfilled in full if I do not supply the “line_items_by_fulfillment_order” array of line items, however, when I provide the previously mentioned array with only the line items I want to fulfill, I get a 404.
Endpoint used to GET fulfillment order:
/admin/api/2024-04/orders/{order_id}/fulfillment_orders.json
Endpoint used to POST the partial fulfillment:
/admin/api/2024-04/fulfillments.json
Below is the body I use to post the partial fulfillment:
{
"fulfillment": {
"message": "Some Message here...",
"notify_customer": false,
"tracking_info": {
"number": "123456789",
"company": "Some courier company"
},
"line_items_by_fulfillment_order": [
{
"fulfillment_order_id": ID_from_Fulfillment_Order_resource,
"fulfillment_order_line_items": [
{
"id": ID_from_Fulfillment_Order_Line_item_resource,
"quantity": 1
}
]
}
]
}
}
I am hoping to receive some clarity on how to split a fulfillment in Shopify using the REST resources.