Installation
npm install --save israel-postal-service-api
Usage
Import library:
import { IPS, Options } from 'israel-postal-service-api';
Define Package Characteristics:
let weightInGrams = 20;
let serviceType = Options.AbroadMailOptions.LETTER.shipmentType;
let serviceSubtype = Options.AbroadMailOptions.LETTER.shipmentSubtypes.regular;
let option = serviceSubtype.options.signed;
let postalService = new IPS();
Calculate Shipping Rate:
let response = await postalService.calculateAbroadShippingRate(
"Spain", weightInGrams, serviceType, serviceSubtype, option);
console.log(response.getTotalPrice());
Supported Environments
- 💻 Browser (including browserify / webpack based environments [such as Angular])
- 🖥 Node.js
Documentation
Support
If you're having any problem, please raise an issue on GitHub and we'll be happy to help.
Contribute
Before submitting a pull request, please make sure that you include tests, and that jshint runs without any warnings: Download VSCode extension.
Test
Run the test suite by executing:
$ npm test
Note:
This API was create as an open source service for makers and entrepreneurs.
This is not an official API for Israel Post service.
Author: Benny Megidish.