Discussions

Ask a Question
Back to All

Showing USPS only

(edited)

I am using a production key to see the courier services available from US to destination US address. But what ever address in US , only 5 USPS services are showing up. I didn't get any idea of why its showing like that. Why it is not showing up fedex ,ups etc services ?
But from US to Singapore its showing other services.
This sample code which I referred from your site have been used in my site with my address locations.
var request = new XMLHttpRequest();

request.open('POST', 'https://api.easyship.com/rate/v1/rates');

request.setRequestHeader('Content-Type', 'application/json');
request.setRequestHeader('Authorization', '');

request.onreadystatechange = function () {
if (this.readyState === 4) {
console.log('Status:', this.status);
console.log('Headers:', this.getAllResponseHeaders());
console.log('Body:', this.responseText);
}
};

var body = {
'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
}
]
};

request.send(JSON.stringify(body));

I hope this code will be okay .What can be the issues?Please help me to fix this as soon as possible.