Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including boxc with all npm packages installed. Try it out:

var boxc = require("boxc")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

boxc v1.515.2

An Unofficial NodeJS Library for BoxC API

BoxC

An Unofficial NodeJS Library for BoxC API

Compatibility: Node.js version 5+

Install with npm:

npm install boxc

Official Documentation HERE

API

Create access token

Generates authorization URL

const BoxC = require('boxc');

// Get authorization url
var authorizationURL = BoxC.getAuthorizationURL(APPLICATION_ID, returnURI);

//... after user got authorized, you get nonce

BoxC.createAccessToken(APPLICATION_ID, APPLICATION_SECRET, nonce)
  .then(accessToken => new BoxC(accessToken));

// if last argument will be true, you don't need invoke "new BoxC(accessToken)"

BoxC.createAccessToken(APPLICATION_ID, APPLICATION_SECRET, nonce, true)
  .then(api => {
    // work with boxc api
  });
    
// or create using (/static?) constructor
(new BoxC(token)) instanceof BoxC
BoxC.create(token) instanceof BoxC

Entry Points

Estimate

Invoices

Labels

Manifests

Overpacks

Shipments

Users

Examples

estimate

api.estimate({
  country: 'US', // not required, now - default & only US
  postal_code: '94041', // destination postal code
  entry_point: 'HKCN', // https://api.boxc.com/site/entry-points
  height: 10, // cm
  width: 10, // cm
  length: 10, // cm
  weight: 0.9 // kg
}).then(estimate => console.log(estimate));

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free