Skip to content

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:

Shell
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:

Request
curl https://api.wasil-iq.com/v1/me \
  -H "Authorization: Bearer $WASIL_KEY"
Answer
{
  "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:

Request
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

Request
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:

Request
curl https://api.wasil-iq.com/v1/packages/1Z999AA10123456784 \
  -H "Authorization: Bearer $WASIL_KEY"

Where to go next

  • Packages: every field and filter.
  • Webhooks: be told about changes instead of asking.
  • Errors: what each error code means and what to do about it.