Reputation: 53
I am integrating Nodejs UPS shipping API with my Website. I am using this module. I used pickup API. But it is throwing an error as Missing or invalid AccountNumber UPS
. Account number that added with my UPS profile is valid. Attaching the Code. Could someone help me figure out what's going wrong here or give some more information about the cause of this error.
var upsAPI = require('shipping-ups');
var util = require('util');
var ups = new upsAPI({
environment: 'sandbox', // or live
username: 's*******2',
password: 'A*******3',
access_key: '*************',
imperial: true // set to false for metric
});
ups.pickup({
rate_pickup_indicator: 'Y',
shipper_account: 'ABC123',
pickup_date: '20141223',
eariest_time_ready: '0800',
latest_time_ready: '1200',
pickup_address: {
company_name: 'Pat Stewart',
contact_name: 'Pat Stewart',
address_line_1: '2311 York Road',
city: 'Timonium',
state_code: 'MD',
postal_code: '21093',
country_code: 'US',
phone_number: '5555555555'
},
weight: 5.5,
pickup_piece: [
{
service_code: '003',
quantity: 1,
container_code: '01'
}
],
payment_method: '01'
}, function(err, res) {
if(err) {
return console.log(util.inspect(err, {depth: null}));
}
console.log(util.inspect(res, {depth: null}));
});
Upvotes: 1
Views: 1337
Reputation: 21
Probably you using wrong environment, e.g sandbox account used in production environment. If you still feel frustrated, I recommend you use Postmen, which is basically a shipping API that allows you to integrate with a lot of couriers(>40). You may a look at the documentation.
Disclaimer: I work for Postmen.
Upvotes: 2