![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
aramex-pillvery
Advanced tools
A simple wrapper for Aramex (JSON) API to manage shipments, tracking, and printing labels.
A Node.js wrapper for the Aramex Shipping API that simplifies creating shipments. It supports both testing and production environments and offers an easy-to-use interface for mapping required parameters.
Install the package using npm:
npm install aramex-pillvery
const Aramex = require('aramex-pillvery');
Create a new instance of the Aramex API wrapper with your credentials and environment settings.
const aramex = new Aramex({
UserName: "your_username",
Password: "your_password",
AccountNumber: "your_account_number",
AccountPin: "your_account_pin",
isTesting: true, // Set to false for production
});
Call the createShipment
method to create a new shipment.
(async () => {
try {
const response = await aramex.createShipment({
client_order_id: "12345",
value: 50,
customer_name: "John Doe",
customer_phone: "962790123456",
pickup_lat: 31.963158,
pickup_lng: 35.930359,
lat: 31.95,
lng: 35.91,
preparation_time: 15, // Default: 1 minute
payment_type: 1, // 1 = CASH, 2 = CREDIT
});
console.log("Shipment created successfully:", response);
} catch (error) {
console.error("Error:", error);
}
})();
Parameter | Type | Description |
---|---|---|
UserName | String | Your Aramex API username. |
Password | String | Your Aramex API password. |
AccountNumber | String | Your Aramex account number. |
AccountPin | String | Your Aramex account PIN. |
isTesting | Boolean | Set to true for the testing environment and false for production. |
createShipment
Method ParametersParameter | Type | Description |
---|---|---|
client_order_id | String | Client's order ID. Mapped to Reference1 . |
value | Number | Value of the shipment. Mapped to CustomsValueAmount.Value . |
customer_name | String | Name of the customer. Mapped to Consignee.Contact.PersonName . |
customer_phone | String | Customer's phone number. Mapped to Consignee.Contact.PhoneNumber1 . |
pickup_lat | Number | Latitude for the shipper's pickup location. Mapped to Shipper.PartyAddress.Latitude . |
pickup_lng | Number | Longitude for the shipper's pickup location. Mapped to Shipper.PartyAddress.Longitude . |
lat | Number | Latitude for the consignee's address. Mapped to Consignee.PartyAddress.Latitude . |
lng | Number | Longitude for the consignee's address. Mapped to Consignee.PartyAddress.Longitude . |
preparation_time | Number | Time in minutes to add to the current time for shipment. Defaults to 1 . |
payment_type | Number | Payment type: 1 for CASH and 2 for CREDIT. Defaults to 1 . |
The createShipment
method returns the response from the Aramex API. Handle the response or errors as needed.
Below is an example of a successful response:
{
"Transaction": {
"Reference1": "12345",
"Reference2": "",
"Reference3": ""
},
"HasErrors": false,
"Shipments": [
{
"ID": "123456789",
"LabelURL": "https://aramex.com/label/123456789.pdf",
"ShipmentTrackingNumber": "123456789"
}
]
}
FAQs
A simple wrapper for Aramex (JSON) API to manage shipments, tracking, and printing labels.
The npm package aramex-pillvery receives a total of 5 weekly downloads. As such, aramex-pillvery popularity was classified as not popular.
We found that aramex-pillvery demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.