Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Shopify Fulfillment Api Returns : Request Failed With HTTP Code 404.

Shopify Fulfillment Api Returns : Request Failed With HTTP Code 404.

MikeMeshkati
Tourist
5 0 3

Hello,
I'm trying to post to the Fulfillment API to fulfill line items on an order using following code:


$config = array(
'ShopUrl' => 'XXXX.myshopify.com',
'AccessToken' => 'myAccessToken'
);


$shopify = new ShopifySDK($config);


$orderID = 111111111111;
$line_items = array();
$line_items[] = array("id" => 22222222222222);
$data = array(
"location_id" => "33333333",
"tracking_number" => null,
"status" => "open",
"line_items" => $line_items
);


$fulfillmentData = $shopify->Order($orderID)->Fulfillment->post($data);


However I'm getting response "Request failed with HTTP Code 404" back from the API. I've verified OrderID, LocationId & LineItemId they are correct (using dummy data in this post)
I've tried it with tracking_number: null, and also with no tracking number at all, but it's always the same: 404.
It was working up until a few days ago.


I can't figure out why it stopped working. I hope someone can help.

 

Replies 13 (13)

Alan
Shopify Staff
129 15 25

Hey @MikeMeshkati - thanks for getting in touch. Could you share an X-Request-ID that would have been sent out in the response headers for your API Call? There could be a few reasons why we might expect a 404 error here and having that ID would help us narrow down what could have happened in this specific case.

 

Hope to hear from you soon - happy to dig into this with you. 

Alan | 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

MikeMeshkati
Tourist
5 0 3

Hi @Alan 
Here is the X-Request-ID : a9427e15-a48f-4435-bb4a-28bb2499b6df from response headers of the API Call.
Thank you for your help.

Alan
Shopify Staff
129 15 25

Hey Mike - no worries. I was able to do a little bit of digging on my end and based on the logs associated with that X-Request ID you shared the endpoint that was called was :"/admin/api/2022-07/orders/[ordernumber]/fulfillment.json" 

Could you try using fulfillments.json instead of fulfillment.json as the endpoint and let us know if that works? This is the only reason why I could think you'd receive a 400 error on this as the rest of your info appears to be correct. 

Hope this helps - as always let us know if we can clarify anything further on our end. Cheers!

Alan | 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

MikeMeshkati
Tourist
5 0 3

Hi @Alan 
I tried https://mystore.myshopify.com/admin/api/2022-07/orders/XXXXXXXXX/fulfillments.json as you suggested. It still gives 404 Error. Here is the X-Request-ID: 7249f8cc-5588-4883-bafb-98349d6aa324 from this call.


Hope to hear from you soon. 

VB_2
Shopify Partner
1 0 2

Hey, @Alan 

Hope you doing well!

I getting the same error 404 

{
    "errors""Not Found"
}

all are working fine with API version 2021-10 and when I switch to version 2022-10 it stop working with the same details.

this is my request ID
X-Request-ID: f3118356-5c14-43da-96f9-eb7b570a31bb

Please, take  a look

Thanks

andrei_trb
Visitor
1 0 0

I'm having the same issue after changing the api-version.

FlorianB
Visitor
1 0 0

Hi @Alan I do encounter the same issue. 

Getting 404 errors . Used to work all year long until a couple of days ago. 

Here is what I submit: 

"https://username:password@mydomain.com/admin/api/2022-07/orders/[orderId]/fulfillments.json"
array(1) {
["fulfillment"]=>
array(3) {
["fulfillment_status"]=>
string(9) "fulfilled"
["location_id"]=>
int(xxx)
["order_id"]=>
int(xxx)
}
}

Any update regarding a solution? 

x-request-id: c74960f8-c8c8-4eba-bbf6-f3f6ba62752a

Thank you very much.

 

Best,

Florian

MikeMeshkati
Tourist
5 0 3

Hi @Alan 
I tried https://mystore.myshopify.com/admin/api/2022-04/orders/XXXXXXXXX/fulfillments.json with
{
"fulfillment": {
"location_id": "xxxxxx",
"tracking_number": null,
"status": "open",
"notify_customer" : false,
"line_items": [
{
"id": 11111111
}]
}

It worked but with 2022-04 API version but when I tried the same thing with 2022-07 API version, it didn't work and returned 404 Status code. 

Here is the x-request-id: b4aa6fd2-ab9b-455f-a9d6-213fdd06b1f3 from 2022-07 api version call.

Looking forward for your reply.

niketedm
Shopify Partner
2 0 2

Same issue for here, we are not able to create the fulfill for the order and everything was working fine until 2 months ago

 

the silence is golden

Baska
Shopify Partner
3 0 0

having the same issue,

tried all api versions 2022/07 and above

it is becoming kinda urgent as we received an email from shopify saying that api version must be updated until April

jankadlec
Shopify Partner
14 0 1

Isn't it deprecated in new version of API and replaced with 

POST /admin/api/2022-07/fulfillments.json ?
Baska
Shopify Partner
3 0 0

hm I am using POST /admin/api/2022-07/fulfillments.json but it doesnt work and returns 404 error,

maybe I need to create a new topic if it is not related to this post

jankadlec
Shopify Partner
14 0 1

It did the same for me, as I was using OrderID instead if FulfilledOrderID...