404 Not Found when Create a Fulfillment Order

keeppack
Shopify Partner
1 0 0

We are querying a fulfillment order via 

GET => /admin/api/2023-01/orders/5165XXXXXX/fulfillment_orders.json

 

'x-request-id': 'b9ae0f12-981d-48f5-8274-f53787415574'

 

 

Then create a fulfillment order with this:

 

POST => /admin/api/2023-01/fulfillments.json

'x-request-id': '901b0d0b-4d9f-422c-a4e6-c95e0b7c58ae'

 

{
"fulfillment": {
   "line_items_by_fulfillment_order": [
        {
             "fulfillment_order_id": 62657206XXXXX
        }
     ]
   }
}

 

RESPONSE:

 

data: { errors: 'Not Found' }

 

 

I've checked the scopes as the docs here => FulfillmentOrder 

 

 

What could be the solution?

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1251 202 443

Hi @keeppack,

 

Thanks for your post. After checking the request-id's that you've provided this looks like a case where the store may have made use of the one-time option to create an alternate .myshopify.com domain, and the POST request is getting submitted to that newer domain. 

 

Requests to a secondary .myshopify.com domain get redirected to the original .myshopify.com domain, and some API clients don't handle the redirect well with POST requests and turn them into GET requests. Since the endpoint at /admin/api/2023-01/fulfillments.json doesn't actually accept GET requests it returns a 404.

 

You should be able to see the redirect and subsequent resubmission of the POST request to a different domain as a GET in your server logs (depending on the logging setup). The domain to POST to would be the one that request ID you shared of 901b0d0b-4d9f-422c-a4e6-c95e0b7c58ae was actually sent to which shows as a GET request in the logs here.

 

Our internal teams are working on a way to make this work better on its own, and in the meantime submitting API requests to the original .myshopify.com domain - that being the one that the requests are being redirected to - is recommended to help prevent issues.

 

Since this is on the forums we're not able to specifically mention those domain names, but if you have collaborator or staff access on the store a way to confirm this would be to go to the Settings > Domains area of the admin which lists all the domains associated with the store.

 

If this doesn't fit please reach out to Support directly to enable more direct discussion about this case and the store involved.

 

Thanks and hope you have a great day

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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