Skip to content

A library which aims to provide a common api for the numerous logistics partners in India

Notifications You must be signed in to change notification settings

elanic-tech/angarum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This Library attempts to unify the API of different delivery providers in India.

Installation

npm install angarum

To add a new partner, use

./generate partner_name

To generate a new partner as partner_name.js . Preferably use lower case letters and underscore.

Usage

var ang = require("angarum");

//To access a partner (case insensitive), we use:
var partner = ang.Partner("delhivery");

//To Create a new order, we use:
var newOrder = new ang.Order({}); //Checkout Schemas/order_schema.js for information on what to pass to ang.Order.
partner.order(newOrder, function(res, body) {
    console.log(res); //Network response object
    console.log(body); // Checkout Schemas/order_schema.js for output json object
})

//Similarly, for tracking url, tracking status and cancellation respectively,
var track = new a.Track();
var tracking_status = new a.TrackingStatus({"awb_number" : "some_awb_no:"});
var cancel = new a.Cancel({});
partner.track(track, (res, body) => {console.log(res, body);});
partner.tracking_status(tracking_status, (res, body) => {console.log(res, body);});
partner.cancel(cancel, (res, body) => {console.log(res, body);});

//See their schemas inside Schemas/ for more information

About

A library which aims to provide a common api for the numerous logistics partners in India

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published