Create FulfillmentEvent with Admin REST API

Hello, I’m trying to create a FulfillmentEvent with the Admin REST API. (I would be happy to do this with GraphQL instead but I believe this isn’t possible.)

I am following the example listed at https://shopify.dev/api/admin-rest/2021-10/resources/fulfillmentevent#%5Bpost%5D/admin/api/2021-10/orders/%7Border_id%7D/fulfillments/%7Bfulfillment_id%7D/events.json.

Using my own order ID and finding the fulfillment ID, I send a POST request with the payload
{“event”{“status”:“in_transit”}}
exactly as it is in the example, but the response I receive is

{“errors”:{“event”:“Required parameter missing or invalid”}}

I know that my order and fulfillment IDs are correct as I receive a ‘not found’ error if I POST bogus numbers.

I cannot understand which parameter is missing or how a status of “in_transit” could be invalid. Appreciate any help on this, thank you.

I just ran into the same issue and adding the following to the cURL request fixed the problem:

curl -d ‘{“event”:{“status”:“in_transit”}}’ \

-X POST “https://your-development-store.myshopify.com/admin/api/2021-10/orders/450789469/fulfillments/255858046/events.json” \

-H “X-Shopify-Access-Token: {access_token}” \

-H “Content-Type: application/json”

Notice the last line:

-H “Content-Type: application/json”

Basically, without the content-type, Shopify is unable to read the body being sent and thinks no parameters were submitted. They should really update their documentation.

2 Likes

That’s brilliant, thanks very much!