https://github.com/bennymeg/israelpostalserviceapi
An API for Israel postal service
https://github.com/bennymeg/israelpostalserviceapi
api israel isreal-postal-service ngx postal-service shipping-rates
Last synced: 3 months ago
JSON representation
An API for Israel postal service
- Host: GitHub
- URL: https://github.com/bennymeg/israelpostalserviceapi
- Owner: bennymeg
- License: apache-2.0
- Created: 2018-10-13T17:52:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T02:55:42.000Z (over 2 years ago)
- Last Synced: 2024-05-01T15:32:41.313Z (about 1 year ago)
- Topics: api, israel, isreal-postal-service, ngx, postal-service, shipping-rates
- Language: TypeScript
- Size: 327 KB
- Stars: 6
- Watchers: 0
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: docs/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Israel Postal Service API
An API for Israel postal service - query shipment price easily.
Supports both NodeJS and browser environments.[](https://github.com/bennymeg/IsraelPostalServiceAPI/blob/master/LICENSE)
[](https://www.npmjs.com/package/israel-postal-service-api)
[](https://david-dm.org/bennymeg/IsraelPostalServiceAPI)
[](https://bennymeg.github.io/IsraelPostalServiceAPI/)
## Installation
```bash
npm install --save israel-postal-service-api
```
## Usage### Import library:
```javascript
import { IPS, Options } from 'israel-postal-service-api';
```### Define Package Characteristics:
```javascript
// define package shipment characteristics
let weightInGrams = 20;
let serviceType = Options.AbroadMailOptions.LETTER.shipmentType;
let serviceSubtype = Options.AbroadMailOptions.LETTER.shipmentSubtypes.regular;
let option = serviceSubtype.options.signed;// initialize service
let postalService = new IPS();
```### Calculate Shipping Rate:
```javascript
// calculate package shipping rate asynchronously
let response = await postalService.calculateAbroadShippingRate(
"Spain", weightInGrams, serviceType, serviceSubtype, option);// see {@class ResponseParser} API to discover the response structure
console.log(response.getTotalPrice());
```## Supported Environments ##
- 💻 Browser (including browserify / webpack based environments [such as Angular])
- 🖥 Node.js## Documentation ##
- 📔 [Full Documentation](https://bennymeg.github.io/IsraelPostalServiceAPI/),
- 👨🏼💻 [API](https://github.com/bennymeg/IsraelPostalServiceAPI/blob/master/docs/API.md),
- 👩🏼🏫 [Examples](https://github.com/bennymeg/IsraelPostalServiceAPI/blob/master/docs/examples),
- 📜 [Change log](https://github.com/bennymeg/IsraelPostalServiceAPI/blob/master/docs/CHANGELOG.md),
- 🖋 [Licence](https://github.com/bennymeg/IsraelPostalServiceAPI/blob/master/LICENSE)## Support ##
If you're having any problem, please [raise an issue](https://github.com/bennymeg/IsraelPostalServiceAPI/issues/new) on GitHub and we'll be happy to help.## Contribute ##
- 👾 [Issue Tracker](https://github.com/bennymeg/IsraelPostalServiceAPI/issues),
- 📦 [Source Code](https://github.com/bennymeg/IsraelPostalServiceAPI/)Before submitting a pull request, please make sure that you include tests, and that [jshint](http://jshint.com) runs without any warnings: [Download VSCode extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.jshint).
## Test ##
Run the test suite by executing:```sh
$ 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.