Not able to return shipping rates, but creates the order

Description

Stopped returning shipping rates, but still creates the order on Ordoro. Started happening today, yesterday everything worked.

When I did:

We first create the order then get back shipping rates, then we select which rate we want.

I expected:

We expect to see shipping rates from USPS.

What actually happened:

Throwing a Failed to load resource: the server responded with a status of 500 (Internal Server Error)
I get that this is an internal error but the server was checked and all other API and get requests work.

Request Details

url: /order/get-shipment-rate,
type: “GET”,

    curl_setopt($ch, CURLOPT_URL, "https://apiverson.ordoro.com/order/$newOrder->order_id/rate/endicia");

part of the requesting url.
/order/get-shipment-rate?weight=48&length=14&width=11&height=3&wooid=9785

in debug mode, I get the following back.
errorexecption
Trying to get property ‘service_type’ of non-object

highlighting the following line. But this code hasn’t changed between yesterday and today. any help is much appreciated.

$rates = $rates->filter(function($item) {
return $item->service_type === ‘Priority’;
});

Response Details

Body

{“readyState”:4,“responseText”:"{\n “message”: “Server Error”\n}",“responseJSON”:{“message”:“Server Error”},“status”:500,“statusText”:“Internal Server Error”}

Request ID

is this the same as the shipper id?

Hi!

I’m a bit confused as to what the issue you are experiencing is. I see you are saying you use the url /order/order_id/rate/endicia, but in another spot you are saying something like /order/get-shipment-rate, the latter of which is not an Ordoro url.

RE: the Request ID. No, not the same as the shipper id. In the response headers you should see both x-api-request-id as well as x-apiverson-request-id. Please provide this information so we can search our logs for your specific request.

Please clarify your request so we can dig into this some more

Sorry for the confusion its a get request
curl_setopt($ch, CURLOPT_URL, “https://apiverson.ordoro.com/order/$newOrder->order_id/rate/endicia”);

It seems we had a code that does clean up for non shipped orders that was deleting it quicker than the response we were getting from your server. so it was throwing a server error, since there was nothing to ship.

But I’m also needing to put a delay into the code between creation of the order and getting rates or else I get an issue.

Ah, that makes sense. Thank you for the clarification.

Yes on order creation we run a series of automation so it takes a few seconds before the order is ready. We validate addresses, check for dropshipping applications, and if you have them we’ll also run automation rules.

The delay from order POST to order ready is to be expected.