Issue with accepting a fulfillmentorder

solexsylvain
New Member
3 0 0

Hi everyone,

When accepting a fulfillment request through fulfillment_orders/{fullFillmentOrderId}/fulfillment_request/accept.json,

I'm getting an error "The fulfillmentOrder is not an open state" but it still does something because the fulfillment order have the request status go from submitted to accepted and the status go from open to in progress.I checked this information with the API.

Then I can proceed with the fulfillments.

If I don't accept the fulfillmentOrder, I can't do fulfillments on the fulfillment order.

For context, I'm using the AssignedFulfillmentOrder endpoint to get the orders assigned to my app and then accept them.
it's a fulfillment service and the orders are automatically assigned base on product location.

0 Likes
mitchellbrenda6
New Member
1 0 0
0 Likes
awwdam
Shopify Staff
Shopify Staff
55 4 1

Hey @solexsylvain, would you be able to provide us with an X-Request-Id header and example of the payload body sent where you saw this unexpected behaviour? We can absolutely take a closer look at what might be happening from there. Thanks!

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
solexsylvain
New Member
3 0 0

Thank you @awwdam. Had to look up the X-Request-Id header.

Will get back to you this morning.

 

0 Likes
solexsylvain
New Member
3 0 0

Hi @awwdam,

Forget about all of that.

The problem was me.

I forgot to remove an extra line of code that was making a somewhat bad request (missing a bit of data) but Shopify was accepting it and changing the values as it should.

Then the line, the one I actually wanted, ran and threw an error as the status was already changed.

I removed it and ran the code again. It's working fine.

For future reference, is X-Request-Id a value you would have wanted me to put in a header and provided the value through here  or is it something you always send in a response ?

Thank you for your help.

0 Likes
awwdam
Shopify Staff
Shopify Staff
55 4 1

Hey @solexsylvain glad to hear you got this sorted on on your end! For future reference, the X-Request-Id is a unique response header that is assigned and returned for each API request you make. 

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes