2020.12.1 • Published 3 years ago

purplship-node v2020.12.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Purplship Node.js Library

Purplship is a Multi-carrier Shipping API that simplifies the integration of logistic carrier services.

Visit purplship.com to deploy your private cloud multi-carrier shipping API.

Documentation

See the full API docs.

Installation

Install using NPM or Yarn

npm i purplship-node
# or 
yarn add purplship

Usage

The package needs to be configured with your account's API key, which is available in the Purplship Dashboard.

const Purplship = require('./purplship');
const purplship = new Purplship('API_KEY', 'https://instance.purplship.api/v1');

purplship.carriers.list()
    .then(carriers => console.log(carriers))
    .catch(error => console.error(error));

Or using ES modules and async/await:

import Purplship from 'purplship';
const purplship = new Purplship('API_KEY', 'https://instance.purplship.api/v1');

(async () => {
  const carriers = await purplship.carriers.list();

  console.log(carriers);
})();