Solved

Create FulfillmentEvent with Admin REST API

Shaun16
Tourist
4 0 0

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/o....

 

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.

Accepted Solution (1)

Thibault1
Visitor
1 1 2

This is an accepted solution.

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

curl -d '{"event":{"status":"in_transit"}}' \
-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.

View solution in original post

Replies 2 (2)

Thibault1
Visitor
1 1 2

This is an accepted solution.

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

curl -d '{"event":{"status":"in_transit"}}' \
-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.
Shaun16
Tourist
4 0 0

That's brilliant, thanks very much!