apoo / shippo-node-client

Shipping API Node.js library (USPS, FedEx, UPS and more)

Home Page:https://goshippo.com/integrate-shipping-label-api/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#Shippo Node.js API wrapper

Shippo is a shipping API that connects you with multiple shipping providers (such as USPS, UPS, and Fedex) through one interface, and offers you great discounts on shipping rates.

Don't have an account? Sign up at https://goshippo.com/

Installation:

You can install this package by running the follwing command:

  npm install shippo

This means, you don't actually have to download this repository. If you wish to make modifications to the wrapper, you can clone this repository into your project.

Requirements:

The shippo Node.js has the following dependencies:

  npm install when

Usage:

Every resource is accessed via your shippo instance:

    var shippo = require('shippo')('<YOUR_PRIVATE_KEY>');

The snippet below demonstrates how to create an address object. check examples.js for more detailed example for generating a shipping label:

    var shippo = require('shippo')('<YOUR_PRIVATE_KEY>');
    
    shippo.address.create({
          'object_purpose' : 'PURCHASE',
          'name' : 'Mr Hippo',
          'company' : 'SF Zoo',
          'street1' : '2945 Sloat Blvd',
          'city' : 'San Francisco',
          'state' : 'CA',
          'zip' : '94132',
          'country' : 'US',
          'phone' : '+1 555 341 9393',
          'email' : 'mrhippo@goshippo.com'
    }).then(function(address){
    console.log("shipment : %s", JSON.stringify(address));
    });

Tests:

Requirements:

For the test cases the following packages are required:

  npm install mocha
  npm install chai
  npm install mocha-as-promised
  npm install chai-as-promised

Credits

This project was influenced by the excellent stripe-node.

Author

Maintained by support@goshippo.com . Happy to see contributions and feedback - fork away!

About

Shipping API Node.js library (USPS, FedEx, UPS and more)

https://goshippo.com/integrate-shipping-label-api/

License:MIT License


Languages

Language:JavaScript 99.5%Language:Makefile 0.5%