Discussions

Ask a Question
Back to All

Cannot get rates from default API

API returns ["Sorry, we couldn't find any shipping solutions based on the information provided."]}"

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.easyship.com/rate/v1/rates");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);

curl_setopt($ch, CURLOPT_POST, TRUE);

curl_setopt($ch, CURLOPT_POSTFIELDS, "{
"origin_country_alpha2": "SG",
"origin_postal_code": "WC2N",
"destination_country_alpha2": "US",
"destination_postal_code": "10030",
"taxes_duties_paid_by": "Sender",
"is_insured": false,
"items": [
{
"actual_weight": 1.2,
"height": 10,
"width": 15,
"length": 20,
"category": "mobiles",
"declared_currency": "SGD",
"declared_customs_value": 100
}
]
}");

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Content-Type: application/json",
"Authorization: Bearer YOUR-TOKEN"
));

$response = curl_exec($ch);
curl_close($ch);

var_dump($response);