Discussions

Ask a Question
Back to All

API issues: sandbox always giving "couldn't find any shipping solutions" error, USPS options only from production

I am using PHP and cURL. Domestic shipment in the USA.

  1. No matter what address or parcel information I enter, the sandbox environment always returns the error "Sorry, we couldn't find any shipping solutions based on the information provided". Using exactly the same address and parcel information but entering my production token instead, it does work and returns results. BUT...

  2. The rates returned from the production environment only show USPS options. No UPS or FedEx.

The PHP/cURL code is copied directly from the API documentation page ():

"https://api.easyship.com/v2/rates", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => '{ "incoterms":"DDU", "insurance":{"is_insured":false}, "courier_selection":{"apply_shipping_rules":true}, "shipping_settings":{ "units":{ "weight":"lb", "dimensions":"in" } }, "origin_address":{ "contact_name":"", "line_1":"", "city":"HARTVILLE", "state":"MO", "postal_code":"65667", }, "destination_address":{ "contact_name":"", "line1":"", "city":"Norwood", "state":"MO", "postal_code":"65717", "country_alpha2":"US" }, "parcels":[{ "total_actual_weight":6, "box":{ "length":12, "width":9, "height":6 }, "items":[{ "category":"accessory_battery", "description":"multimeter", "actual_weight":3, "declared_currency":"USD", "declared_customs_value":200 }] }] }', CURLOPT_HTTPHEADER => [ "Accept: text/plain", "Authorization: Bearer ", "Content-Type: application/json" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ?>