Getting started
Quickstart
From a new key to your first package list in five minutes.
Still building? Do all of this with a test key first. The sandbox is the same API on test data: same address, same requests, nothing real is touched. Going live is then a change of key.
1. Create a key
Sign in to the partner portal, open Account → API keys and create a key.
It starts with wsk_ and is shown once: copy it into your server's configuration straight away.
The examples below read the key from an environment variable:
export WASIL_KEY=wsk_your_key_here
2. Check that it works
The API lives at https://api.wasil-iq.com/v1. Ask it who you are:
curl https://api.wasil-iq.com/v1/me \
-H "Authorization: Bearer $WASIL_KEY"
{
"data": {
"name": "Example Store",
"code": "EX",
"mode": "live",
"plan": "Standard",
"modules": { "tracking": true, "rates": true, "webhooks": false, "write": false },
"requests_per_minute": 60
}
}
modules tells you what your account may use. An endpoint of a module that is off answers 403 with the code module_disabled.
3. See your accounts
You can read the packages of the Wasil accounts that belong to you. List them:
curl https://api.wasil-iq.com/v1/accounts \
-H "Authorization: Bearer $WASIL_KEY"
If the list is empty, no account is linked to your partner account yet: ask your Wasil contact, or create customers if you have that module.
4. Read packages
curl "https://api.wasil-iq.com/v1/packages?per_page=5" \
-H "Authorization: Bearer $WASIL_KEY"
A single package is found by the carrier's tracking number or by its Wasil id:
curl https://api.wasil-iq.com/v1/packages/1Z999AA10123456784 \
-H "Authorization: Bearer $WASIL_KEY"