Hey there,
I am curently working on an integration for one of our clients and we are trying the new 2023-04 API.
We need to fulfill an specific order. We use an post request to /admin/api/2023-04/fulfillments.json. In that post request, we have this line:
"line_items_by_fulfillment_order": [
{
"fulfillment_order_id": ###########
}
]
That fulfillment_order_id is not the ID of the order. It is the ID of the fulfilment, but which fulfillment? I am trying to create one, so how can I have an id?
In the portal, when i want to fullfill an order, it redirects me to a page where I can select the products, fill in the tracking information and more. In the URL, we have /orders/####/fulfillment_orders/###/fulfill?locationId=###. In that url, we have the fulfilment ID after the /fulfillmen_orders/. When I am using that id, everyting works. But how to get that ID with the API?
Any suggestions?
Thanks in advance!
1 Like
For everyone wondering, I fixed it. There is a difference between fulfillment belonging to an order, and fulfilment_orders from an order. There always is an fulfillment_order_id that you can lookup with this endpoint:
https://store.myshopify.com/admin/api/2023-04/orders/{orderid}/fulfillment_orders.json
With that endpoint, you can retrieve the fulfilment_order_id that you can use for the fulfillment endpoint to create a new fulfillment with the order data, tracking number and more.
3 Likes
Hey Devserge, I have the same need as you. I tried your solution but for some reason I get an empty object “fulfillment_orders”:
In the Order > Fulfill link for a specific order, I see there is indeed a fulfillment_order ID = 6602265657600
URL ends in : /orders/5526506176768/fulfillment_orders/6602265657600/fulfill?locationId=33563213933
And in my endpoint/request I use this same Order ID:
/admin/api/2023-04/orders/5526506176768/fulfillment_orders.json
Any idea of why might this be happening? Thanks!
Hi Tomaspasqualini, i am using this one to get the
fulfillment_order_id: [email removed]
and then i use this one to actually fulfill the order:
[email removed]
with this json as body:
{
“fulfillment”:
{
“line_items_by_fulfillment_order”:
[
{
“fulfillment_order_id”:6602265657600
}
],
“notify_customer”: true,
“tracking_info”:
{
“number”:“MS1562678”,
“url”:“https://www.my-shipping-company.com?tracking_number=MS1562678”
}
}
}
1 Like