postnl-sdk
v0.3.0
Published
Unofficial PostNL SDK for Node.js inspired by Resend
Downloads
15
Readme
Unofficial PostNL Node.js SDK
This is an unofficial Node.js SDK for the PostNL API. It is a wrapper around the PostNL API, which is a RESTful API that allows you to create shipments, request shipping labels, and track shipments.
This SDK is not affiliated with PostNL.
Refer to PostNL API documentation for more information.
Installation
npm install postnl-sdk
Usage
import { PostNL } from 'postnl-sdk';
const postnl = new PostNL('your-api-key');
The api key is optional. If not provided, it will search for the POSTNL_API_KEY
environment variable.
Example
Generate a barcode of type 3S:
const payload: GenerateBarcodeOptions = {
CustomerCode: "DEVC",
CustomerNumber: "11223344",
Type: '3S',
};
const barcode = await postnl.barcode.generate(payload);
// Output: { Barcode: '3SDEVC903942795' }
Roadmap
- [ ] Send & Track
- [x] Barcode
- [x] Generate barcode
- [x] Tests
- [ ] Confirming
- [x] Confirm shipment
- [ ] Tests
- [ ] Labelling
- [x] Generate label
- [ ] Tests
- [ ] Shipment
- [x] Generate shipment label
- [x] Tests
- [ ] Shipping Status
- [ ] Get status by barcode
- [ ] Get status by reference
- [ ] Get shipment signature
- [ ] Get updated status by customer number
- [ ] Tests
- [x] Barcode
- [ ] Checkout & Delivery options
- [ ] Checkout
- [ ] Checkout
- [ ] Tests
- [ ] Locations
- [ ] Get pickup locations by address
- [ ] Get pickup locations by coordinates
- [ ] Get pickup locations within area
- [ ] Get pickup location
- [ ] Tests
- [x] Postalcode check
- [x] Checkout postalcode check
- [x] Tests
- [ ] Timeframes
- [ ] Retrieve delivery timeframes
- [ ] Tests
- [ ] Checkout