Hello. I am trying to fulfill a specific line item in an order through the REST API. I am using the fulfillments.json endpoint and my payload is like this
[
'fulfillment' => [
'message' => 'Fulfill Attempt',
'notify_customer' => true,
'tracking_info' => [
'number' => '{SOME_NUMBER}',
'url' => '{SOME_TRACKING_URL}',
'company' => '{COMPANY}',
],
'line_items_by_fulfillment_order' => [
[
'fulfillment_order_id' => 6103291298038,
'line_item_id' => 12707794977014,
'quantity' => 1,
], [
'fulfillment_order_id' => 6103291298038,
'line_item_id' => 12707795075318,
'quantity' => 0,
], [
'fulfillment_order_id' => 6103291298038,
'line_item_id' => 12707795108086,
'quantity' => 0,
],
],
],
]
The problem is, Shopify API is marking all three line items as fulfilled even though I am passing the proper line item id (The one that I don’t want fulfilled) and quantity as 0. My guess is, because I am passing the fulfillment_order_id parameter which is the same for all 3 items, Shopify is marking them fulfilled. I checked on the Shopify Admin panel. There you can partially fulfill a line item by marking the rest of the line items as 0 out of 1.
Am I missing something in the API? Please help.