Shopify returns order not found although its there

ShiraBoa
Excursionist
13 0 3

Hi,

I get this exception from an outer laravel application that queries shopify:

Exception message: Client error: `GET https://******/admin/orders/4934591.json?fields=name` resulted in a `404 Not Found` response: {"errors":"Not Found"}

Mostly this application runs smoothly, but a few times a day (out of hundreds) I get this error.

When I manually run this get, I get the results - the order is there (and it's not a new one, it was created months ago).

Can you please advise what the reason for this might be?

Thanks,

0 Likes
Andreas_Sch
Excursionist
16 0 0

It's unlikely this is the issue, but check whether the order has been archived.

0 Likes
ShiraBoa
Excursionist
13 0 3
Click to expand...
Not archived..
0 Likes
Greg_Kujawa
Shopify Partner
1016 83 226

What about the order status for these records that are falling between the cracks? Sometimes there are quirks in the REST API query parameters regarding pulling orders that I recall have been discussed in other threads. Specifically regarding order status.

So are you implying that your scripted routine's GET request comes back empty, while if you manually perform the exact same GET request on your own the order is contained in the response?

0 Likes
amosmos
Shopify Expert
33 1 11

We send the GET request once we receive a "refund created" webhhook.

We get the webhook, and we send the request to get the order.

And then we get 404, no order found.

Once we try it again, we do get it.

So we think there's a slight processing time while the order is refunded in which is not available through API. It might be similar to how it works when we transform a draft order into an order and for a short while the order is no available.

But it's not documented anywhere, so we're not sure that's the case.

Thanks,

Amos

0 Likes
Greg_Kujawa
Shopify Partner
1016 83 226

@amosmos I think that's a reasonable assumption. There might be a slight delay between a transaction posting and it becoming "seen" across the various mechanisms. I typically insert a slight delay in processing things on my end as a rule. Since I thankfully am not dealing with tremendous transactional throughput I can afford a couple seconds delay.

0 Likes
amosmos
Shopify Expert
33 1 11

Yes, that's what I assume as well. Also in the Admin interface, when you make a refund, there is a slight delay until the operation is done.

 

I just wonder:

1) Why it is not documented... 

2) Why don't they "fire" the webhook after the operation is complete... Why do we need to wait for it if it is not something we initiated...