Giter Club home page Giter Club logo

easyship-node's Introduction

Easyship Node.js API wrapper

npm version codecov Build Status

You will need to register for a Easyship account to use the Easyship API. It's free to sign up, free to use the API. Only pay to print a live label, test labels are free.

Installation:

You can install this package by running the following command:

  npm install easyship

Usage:

Initialize your easyship instance using your API Access Token provided to you on the API page in the Easyship Dashboard.

  const easyship = require('easyship')('<ACCESS_TOKEN>');

  easyship.rate.create({
    origin_postal_code: '60605',
    destination_country_alpha2: 'US',
    destination_postal_code: '60605',
    taxes_duties_paid_by: 'Sender',
    is_insured: false,
    apply_shipping_rules: true,
    items: [{
      actual_weight: 1.2,
      height: 10,
      width: 15,
      length: 20,
      category: 'mobiles',
      declared_currency: 'SGD',
      declared_customs_value: 100,
    }],
  }).then(({ rates }) => {
    console.log(rates);
  });

Method Overview

HTTP Method Endpoint Methods
POST /rate/v1/rates easyship.rate.create()
POST /shipment/v1/shipments easyship.shipment.create()
POST /shipment/v1/shipments/create_and_buy_label easyship.shipment.createLabel()
PATCH /shipment/v1/shipments/{easyship_shipment_id} easyship.shipment.update()
GET /shipment/v1/shipments/{easyship_shipment_id} easyship.shipment.retrieve()
GET /shipment/v1/shipments easyship.shipment.list()
DELETE /shipment/v1/shipments/{easyship_shipment_id} easyship.shipment.del()
PATCH /shipment/v1/shipments/update_warehouse_state easyship.shipment.updateWarehouse()
POST /label/v1/labels easyship.label.create()
GET /pickup/v1/pickup_slots/{courier_id} easyship.pickup.retrieve()
POST /pickup/v1/pickups easyship.pickup.create()
POST /pickup/v1/direct_handover easyship.pickup.directHandover()
GET /track/v1/status easyship.track.status()
GET /track/v1/checkpoints easyship.track.checkpoints()
GET /reference/v1/categories easyship.categories.list()

Check example.js for more detail.

Credits

This project was created from stripe-node.

Documentation

Please see https://developers.easyship.com/reference documentation.

Sponsor

Buy Me A Coffee

easyship-node's People

Contributors

dplewis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

maustec

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.