Issue In Creates a fulfillment order API, Getting 200 Response Instead Of 201 Created

Hello Everyone,

Issue in /admin/api/2023-01/fulfillments.json

API:Creates a fulfillment for one or many fulfillment orders
After calling the API to create a fulfillment request, we are receiving a 200 OK response instead of the expected 201 Created.
We have not been able to identify any issues with the request body, and we are looking for help.

BODY JSON
{
“fulfillment”: {
“line_items_by_fulfillment_order”: [
{
“fulfillment_order_id”: 5878684385462,
“fulfillment_order_line_items”: [
{
“id”: 12421221548214,
“quantity”: 1
}
]
}
]
}
}


Additionally, I have another question:

https://shopify.dev/docs/api/admin-rest/2023-01/resources/fulfillment#post-fulfillments

Creates a fulfillment for one or many fulfillment orders

line_items_by_fulfillment_order

fulfillment_order_line_items: (array) The fulfillment order line items and the quantity of each which should be fulfilled. If this property is undefined, then all of the fulfillment order line items of the associated fulfillment order are fulfilled.

Does it mean that it is possible to create a fulfillment order successfully without providing the ‘id’ and ‘quantity’ of ‘fulfillment_order_line_items’ if we want to fulfill all items in the order, as mentioned here?


Any help will be greatly appreciated

Thanks!

Hi there Coco,

Yeah the first thing I think is that you may have used the order id for the fulfillment_order_id in line_items_by_fulfillment_order, that needs to be the fulfillment_order_id that you would get from the endpoint orders/{order_id}/fulfillment_orders.json

The answer to your second question is yes. if you only provide the fulfillment_order_id and don’t pass the fulfillment_order_line_items at all it will fulfill all line_items of the fulfillment order.

Cheers,

Gary

1 Like

Thank you so much for your help!