npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

iupick

v1.0.1

Published

iupick API wrapper

Downloads

6

Readme

iupick-node

The iupick Node library wraps the iupick API to facilitate access from applications written in server-side JavaScript.

Keep in mind that this package requires iupick secret keys, contact [email protected] for more information.

Installation

Install the package with:

npm install iupick --save

Usage

Import the library and instantiate a new iupick object.

var Iupick = require('../lib/iupick');

const secretToken = 'sk_sandbox_4bdcd3630417c5119029859c08a7b8d9d97dda79'
const publicToken = '315cdf3ca4dd588ab8e6f7fa4b7aa433c641cadd'
const environment = 'sandbox'

iupick = new Iupick(secretToken, publicToken, environment);

The iupick Node library has multiple resources with methods that call the API and return a callback.

Methods require either your Public or your Secret token, never expose your secret token.

Methods that require your secret_token should never be done from the front-end. Since this methods deal with sensitive information.

Waypoints

The Waypoints resource allows you to interact with all the delivery points from our network that are available to your account.

To pull the full information for a single waypoint. Use getWaypointInformation It requires the waypoint unique id.

iupick.waypoint.getWaypointInformation(20, function(waypoint) {
    waypoint; // information of the waypoint
    });

To get a list of all the coordinates of available waypoints, use getWaypointsLite.

iupick.waypoint.getWaypointsLite(function(waypoints) {
    waypoints; // list of waypoints
    });

You can get all the waypoints close to a Postal Code with getPostalCodeWaypoints.

iupick.waypoint.getPostalCodeWaypoints(95710, function(waypoints) {
    waypoints; // list of waypoints by CP
    });

External Shipments

If you want to generate a shipment to one of iupick delivery points, but not though our Waybill API, you will need to create a confirmation token so our points are able to receive your package.

iupick.shipment.confirmShipmentWaypoint({waypoint: 486, orderId: "ORDER666"},
  function(confirmation){
    conformation; // A confirmation token
  });

The waypoint argument receives the id of the point you want to ship to, the orderId is your own generated order id.

Shipments with iupick

The iupick API allows the generation of waybills with our available carriers, and tracking your shipment.

The waybill generation occurs on three steps:

Step 1

Create a shipment on the iuPick platform and receive a shipment token.

iupick.shipment.create({length: 8, width: 8, height: 8, weight: 1.1},
    function(shipmentToken) {
    shipmentToken; //the created shipment token
    });

Step 2

Fill the rest of the information required to generate a waybill, and receive a confirmation token.

 You can send a shipment either to an arbitrary direction or to one
 of our waypoints; just replace the waypoint_id attribute for a recipient
 address.

 ``` js
 var shipperAddress = iupick.createAddress(
     city = 'Querétaro',
     lineOne = 'Epigmenio Gonzáles 500',
     postalCode = 76130,
     lineTwo = '',
     neighborhood = 'Momma'
     );

 var shipperContact = iupick.createPerson(
     personName = 'Tony Stark',
     phoneNumber = '555555555',
     emailAddress = '[email protected]',
     title = 'CEO',
     companyName = 'Stark Industries',
     phoneExtension = '123'
     )

 var recipientContact = iupick.createPerson(
     personName='Steve Rogers',
     phoneNumber='555555555',
     emailAddress='[email protected]',
     title='Agent',
     companyName='SHIELD',
     phoneExtension='123'
     )
 ```

 ```js
 iupick.shipment.addInformation({

shipmentToken: shipmentToken, waypointId: 486, shipperAddress: shipperAddress, shipperContact: shipperContact, recipientContact: recipientContact, thirdPartyReference: 'I am a shipment'}, function(confirmationToken) { confirmationToken; // the created confirmation token });


### Step 3.

Generate your waybill with your confirmation token.

``` js
iupick.shipment.generateWaybill(
    confirmationToken,
    function(waybill) {
    waybill // the created waybill link, tracking number and carrier
    });

Tracking your shipment

In order to track a shipment send the carrier and the tracking number.

iupick.shipment.track({carrier: 'Estafeta', trackingNumber: '8055241528464720099314'},
    function(status){
    status; // the tracking status
    });