Discussions

Ask a Question
Back to All

Error: get rate and create shipment

I have an error when trying call a request to get quota from API: "https://api.easyship.com/2022-10/rates" and I used sandbox token to call it.
The response following bellow: "Oops, an unexpected error occurred. Please check your request and try sending it again. You can contact us if the problem persists".
This is my request id: "eb5c96a47e8e67d96e83267ec58db787". How I can resolve it?

  • Response
    {
    "status": "failure",
    "errors": [
    "Oops, an unexpected error occurred. Please check your request and try sending it again. You can contact us if the problem persists."
    ],
    "request_id": "eb5c96a47e8e67d96e83267ec58db787"
    }
  • My body request

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.easyship.com/2022-10/rates', [
'body' => '{"origin_address":{"state":"Central Singapore Community Development Council","city":"Singapore","postal_code":"200634","country_alpha2":"SG"},"destination_address":{"line_1":"91 Geylang Road","state":"Singapore","city":"Singapore","postal_code":"200634","country_alpha2":"SG"},"incoterms":"DDU","insurance":{"is_insured":true},"courier_selection":{"apply_shipping_rules":true},"shipping_settings":{"units":{"weight":"kg","dimension":"cm"}},"parcels":[{"items":[{"quantity":1,"dimensions":{"length":10,"width":10,"height":10},"actual_weight":0.5,"declared_currency":"SGD","declared_customs_value":10,"category":"fashion"}]}]}',
'headers' => [
'accept' => 'application/json',
'authorization' => 'Bearer sand_GeEm6pz6/iR/8xvVH3PmsP/vizWDszDNwXvBkVsu+kA=',
'content-type' => 'application/json',
],
]);

echo $response->getBody();

Thanks!