Set an order as fulfilled via API getting a 404

Set an order as fulfilled via API getting a 404

Fausto1
Shopify Partner
4 0 0

I am trying to manually set an order fulfilled via APIs.

This is the endpoint I am calling:  https://*******.myshopify.com/admin/api/2024-01/fulfillments.json via POST

with the X-Shopify-Access-Token and Content-Type in the headers

I pass this JSON:

 

 

 

{
    "fulfillment": {
        "message": "The package was shipped this morning",
        "line_items_by_fulfillment_order": [
            {
                "fulfillment_order_id": 5879128850767,
                "fulfillment_order_line_items": []
            }
        ]
    }
}

 

 

 

Where the fulfillment order id is the one I got from the url of my order on the backoffice.

 

I am getting a 404. What can this be?

Replies 2 (2)

Fausto1
Shopify Partner
4 0 0

I think I am understanding the problem. I am using the order_id and not the fulfillment_order_id.
In the documentation is stated that the fulfillment_order_id is automatically created upon order creation. What should I call to get the fulfillment_order_id given the order_id?

SBD_
Shopify Staff
1829 271 413

Hey @Fausto1 

 

I suspect you might be passing the order ID instead of the fulfillment order ID.

 

You can get the fulfillment order ID here:/admin/api/2023-10/orders/<order-id>/fulfillment_orders.json

Scott | Developer Advocate @ Shopify