README
vipshipper
Instalation
npm i vipshipper
Usage
Initialize
initialize parameters:
apiId: API_ID, required
apiKey: API_KEY, required
format: 'JSON, xml', optional, default : 'json'
apiUrl: API_URL, optional, default : https://www.verykship.com/api
dev: boolean, optional, default : false
** when dev is true, default apiUrl became http://3hlrnj.shipper.d.veryk.com/api **
const configs = {
apiId: API_ID,
apiKey: API_KEY
}
const { Vipshipper } = required('vipshipper');
const shipper = new Vipshipper(configs);
_ Important _
Initialize the 'shipper' for each api call, do not use it globally.
Methods
quote
let quoteCriteria = {...details, see vipshipper api doc}
const request = await shipper.shipment.quote(quoteCriteria);
create
let inputs = {...details, see vipshipper api doc}
const request = await shipper.shipment.create(inputs);
retrieve label
orderId (vipshipper order id)
const request = await shipper.shipment.label(orderId);
cancel
reason: string (void reason)
id: string (vipshipper order id)
const request = await shipper.shipment.cancel({
id, reason
});