Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

paccurate

remarkablemark660MIT2.4.0TypeScript support: included

Reduce fulfillment costs and wasted material by finding the optimal way to pack every shipment, in real time.

paccurate, pack, ship, rest, api

readme

paccurate

NPM

NPM version build codecov

Node.js client library for Paccurate. The types are generated from Paccurate Swagger.

See docs and demo.

Quick Start

import { pack } from 'paccurate'

const data = await pack({
  key: 'YOUR_API_KEY',
  itemSets: [
    {
      refId: 0,
      dimensions: { x: 5.5, y: 6, z: 6 },
      quantity: 3,
      weight: 4.5,
    },
  ],
  boxTypeSets: ['customer'],
})

console.log(data)

Documentation

Prerequisites

Installation

NPM:

npm install paccurate

Yarn:

yarn add paccurate

Usage

The package needs to be configured with your account's secret key:

const { Paccurate } = require('paccurate')

const paccurate = new Paccurate('YOUR_API_KEY')

paccurate
  .pack({
    // ...
  })
  .then((data) => console.dir(data, { depth: null }))
  .catch((error) => console.error(error.code, error.message))

The same can be done with ES Modules and async-await:

import { Paccurate } from 'paccurate'

const paccurate = new Paccurate('YOUR_API_KEY')

async function main() {
  try {
    const data = await paccurate.pack({
      // ...
    })
    console.dir(data, { depth: null })
  } catch (error) {
    console.error(error.code, error.message)
  }
}

main()

API Endpoint

The request can be sent to two endpoints:

Endpoint Description
https://api.paccurate.io/ 30-second timeout, best for real-time
https://cloud.api.paccurate.io/ 1 hour timeout, best for large, parallel batch jobs

The default endpoint is https://api.paccurate.io/. To send to a different endpoint, you can:

  1. Instantiate with endpoint:

    import { Paccurate } from 'paccurate'
    
    const paccurate = new Paccurate('YOUR_API_KEY', 'https://cloud.api.paccurate.io/')
    await paccurate.pack(data)
  2. Call method with endpoint:

    import { Paccurate } from 'paccurate'
    
    const paccurate = new Paccurate('YOUR_API_KEY')
    await paccurate.pack(data, 'https://cloud.api.paccurate.io/')
  3. Call function with endpoint:

    import { pack } from 'paccurate'
    
    await pack(data, 'https://cloud.api.paccurate.io/')

TypeScript

The following types can be imported:

import type { Body, Response } from 'paccurate'

Migration

v2

Updated Paccurate Swagger version from 1.7.0 to 1.7.1.

BREAKING CHANGE: Pack property key has been removed from Swagger.

Contributing

Contributions are welcome! See our guide on how to proceed. 👋

License

MIT

changelog

Changelog

2.4.0 (2026-01-03)

Features

  • types: bump Paccurate Swagger version from 1.8.0 to 1.9.0 (277d5f3)

2.3.0 (2025-06-30)

Features

  • types: bump Paccurate Swagger version from 1.7.3 to 1.8.0 (93d8e1d)

2.2.1 (2025-03-23)

Build System

  • package: move @types/node-fetch from deps to optional peerDeps (90246a7)

2.2.0 (2025-02-24)

Features

  • types: bump Paccurate Swagger version from 1.7.2 to 1.7.3 (e2584b6)

2.1.0 (2024-10-03)

Features

  • types: bump Paccurate Swagger version from 1.7.1 to 1.7.2 (45cf4bd)

2.0.1 (2024-08-28)

Continuous Integration

  • github: publish package to npm registry with provenance (00cca03)

2.0.0 (2024-08-01)

⚠ BREAKING CHANGES

  • types: Pack property key has been removed from Swagger

Features

  • types: bump Paccurate Swagger version from 1.7.0 to 1.7.1 (27eeeb6)

1.6.0 (2024-04-26)

Features

  • types: bump paccurate swagger from 1.6.1 to 1.7.0 (e4847e2)

1.5.0 (2024-03-26)

Features

  • types: bump paccurate swagger from 1.5.7 to 1.6.1 (1acfe29)

1.4.4 (2023-12-30)

Build System

  • deps: bump @types/node-fetch from 2.6.4 to 2.6.10 (9f71fdf)

1.4.3 (2023-08-26)

Build System

  • deps: bump node-fetch from 2.6.12 to 2.7.0 (#287) (31d437a)

1.4.2 (2023-07-22)

Build System

  • rename directory module to esm (6381db8)

1.4.1 (2023-07-01)

Build System

  • deps: bump node-fetch from 2.6.11 to 2.6.12 (#231) (1e7969d)

1.4.0 (2023-06-28)

Features

  • module: add ECMAScript modules (ESM) support (6ad8f40)

1.3.0 (2023-02-26)

Features

  • update types for paccurate version 1.5.7 (6560824)

1.2.0 (2022-04-28)

Features

  • allow custom API endpoint to be passed (f29f006), closes #7

1.1.0 (2022-04-16)

Features

  • generate swagger.ts given paccurate swagger version 1.5.4 (fa49fbd)
  • use and export paccurate swagger types (43b8a67)

1.0.0 (2022-04-14)

Features