Developers
The YallaRoute API
Book deliveries, read their status and receive events from your own systems. Plain JSON over HTTPS, bearer keys and signed webhooks. This page is the overview. The full reference, with every field and a console that sends real requests, is inside your workspace.
- Base URL
- https://deliverysystem-zeta.vercel.app/api/v1
- Format
- JSON over HTTPS
- Authentication
- Authorization: Bearer ks_live_…
- Addresses
- Any country: lines, city, region, postal code, country, coordinates
- Rate limit
- 120 requests a minute for each key
- Lists
- Up to 100 to a page, with a cursor
- Safe retries
- Idempotency-Key, remembered for 24 hours
- Webhooks
- 17 events, signed with HMAC-SHA256, body format 2026-12-01
Before you start
Where keys and webhooks are managed
There are two places, for two kinds of user. Both need a sign-in.
You run the delivery company
Keys for your whole operation
Console · Developers · /ops/developers
Create keys with the read, write or admin scope, add webhook endpoints, read the request log and try any endpoint in a console that sends real requests with your own data.
A key made here covers your whole company unless you tie it to one customer account. The API is included in Growth, Scale and Enterprise, and webhooks in Growth, Scale and Enterprise. No workspace yet? Start free.
You send with a delivery company that uses YallaRoute
Keys for your own account
Customer portal · Developers · /portal/developers
Your delivery company gives you a sign-in to its customer portal. On the Developers screen there you create keys that belong to your account and add your own webhook endpoints.
A portal key sees and books only your own deliveries. Portal accounts are created by the delivery company, not by YallaRoute: ask the company you send with for access.
Quick start
From workspace to first event
- Step 1 of 4
Open a workspace
Create a workspace for your delivery company, or sign in to the one you have. Start free. - Step 2 of 4
Create a key
In the console open Developers, create a key with the lowest scope that does the job and copy it when it is shown. It is shown once. - Step 3 of 4
Make a first request
GET the base URL to see the endpoints and the limits in force. It needs no key. Then list your shipments with the key. - Step 4 of 4
Listen for events
Add a webhook endpoint and check its signature. Your system is then told when a delivery goes out, is delivered or fails.
curl https://deliverysystem-zeta.vercel.app/api/v1curl "https://deliverysystem-zeta.vercel.app/api/v1/shipments?state=out&limit=25" \
-H "Authorization: Bearer $DELIVERY_API_KEY"Authentication
API keys and scopes
Every request except the index and public tracking carries an API key in the Authorization header as a bearer token. Keys begin ks_live_. The full key is shown once, when it is created. After that the workspace keeps only a hash of it, with a short prefix and the last four characters so that you can tell keys apart. Store it somewhere safe straight away.
Each key has one scope, and a higher scope includes the ones below it. A key belongs to one company and can never read another company's data.
Keys tied to one customer account. In the API a sender is one of your customer accounts. A key tied to a sender sees only that sender's deliveries, always books for that sender, is priced at that sender's rates, and is refused on company-wide endpoints such as vehicle positions. Use one whenever a customer's own system calls the API.
Keep keys on a server. Answers allow requests from any origin so that public tracking can be called from a web page, but a key placed in a page or an app can be read by anyone. If a key leaks, revoke it and create another.
Authorization: Bearer ks_live_YOUR_KEY| Scope | What it allows |
|---|---|
read | List and read shipments and labels, price a delivery, check an address against the coverage, list the company's locations, and read daily figures and vehicle positions. |
write | Everything in read, plus booking and cancelling deliveries. |
admin | Everything in write, plus adding and removing webhook endpoints. |
| No key | The index at the base URL, which lists every endpoint, and public tracking for one parcel. |
A missing key answers 401 missing_key, an unknown or revoked one 401 invalid_key, a key whose scope is too low 403 insufficient_scope, and a key of a suspended workspace 403 workspace_suspended.
Endpoints
What you can call
Paths are shown in full. A GET request to https://deliverysystem-zeta.vercel.app/api/v1 needs no key and returns this list with the version and the limits in force.
| Endpoint | Scope | What it does | With a key tied to one sender |
|---|---|---|---|
| GET/api/v1 | No key | API index | No key is used. |
| GET/api/v1/track/{id} | No key | Track a parcel | No key is used. |
| GET/api/v1/shipments | read | List shipments | Only that sender's shipments. |
| POST/api/v1/shipments | write | Book a delivery | Always books for that sender; sender_id may be left out. |
| GET/api/v1/shipments/{id} | read | Read one shipment | Only that sender's shipments; others answer 404. |
| POST/api/v1/shipments/{id}/cancel | write | Cancel a shipment | Only that sender's shipments; others answer 404. |
| GET/api/v1/shipments/{id}/label | read | Label data | Only that sender's shipments; others answer 404. |
| POST/api/v1/rates/quote | read | Price a delivery | Priced at that sender's contract rate. |
| GET/api/v1/coverage/check | read | Check an address | Works the same. |
| GET/api/v1/locations | read | List locations | Refused with 403: the list covers the whole company. |
| GET/api/v1/stats | read | One day of figures | Counts only that sender's parcels; runs is null. |
| GET/api/v1/fleet/positions | read | Live vehicle positions | Refused with 403: positions cover every sender's parcels. |
| GET/api/v1/webhooks | admin | List webhook endpoints | Refused with 403. Senders manage their own endpoints in the sender portal. |
| POST/api/v1/webhooks | admin | Add a webhook endpoint | Refused with 403. |
| DELETE/api/v1/webhooks/{id} | admin | Remove a webhook endpoint | Refused with 403. |
This page is an overview. Every parameter, every field of every answer and every error for each endpoint is in the reference inside your workspace (console, Developers screen), next to a console that sends real requests with your own data.
Booking
Book a delivery
POST /api/v1/shipments books a delivery exactly as the console does: the address is located, the price comes from your live rate card and the promised window from the service.
| Field | Required | Notes |
|---|---|---|
service | Yes | The id of one of your delivery services. |
sender_id or sender | Yes, unless the key is tied to a sender | The customer account the delivery is for, or a one-off sender given by name, with an address object of its own. |
recipient | Yes | name is required. phone, email and business are optional; phone and email decide which delivery messages can be sent. |
address | Yes | An address object for any country: line1 (required), line2, city, region, postal_code where the country uses one, country as a two-letter ISO 3166-1 code (your company's own if left out), and latitude and longitude to place it yourself instead of having it looked up. |
parcel | Yes | weight_kg is required. dimensions_cm, declared_value, goods and pieces are optional. Each piece gets its own tracking number. |
handling | No | Flags: fragile, signature_required, age_check, chilled and insured. insured needs parcel.declared_value. With age_check, age_min sets the age the driver checks for, from 16 to 25; left out, the minimum age in your booking rules applies. |
cod | No | An amount to collect at the door, in your workspace's currency. |
order_ref, note | No | Your own reference, searchable in the console, and instructions for the driver. |
slot_start | No | The start of a timed slot as an ISO 8601 time, for the scheduled service. The hour has to fall inside the company's delivery hours, on one of its delivery days. |
handover_code | No | Ask the recipient to read out a code at the door. |
curl -X POST "https://deliverysystem-zeta.vercel.app/api/v1/shipments" \
-H "Authorization: Bearer $DELIVERY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1001" \
-d @booking.json{
"service": "YOUR_SERVICE_ID",
"sender_id": "YOUR_SENDER_ID",
"order_ref": "ORDER-1001",
"recipient": {
"name": "Alex Morgan",
"email": "alex@example.com"
},
"address": {
"line1": "1 Example Street",
"line2": "Unit 4",
"city": "Example City",
"postal_code": "POSTAL_CODE_IF_USED",
"country": "COUNTRY_CODE"
},
"parcel": {
"weight_kg": 2.4,
"dimensions_cm": [
30,
20,
10
],
"goods": "Books"
},
"handling": {
"signature_required": true
},
"note": "Leave with reception"
}The answer is 201 with the new shipment in full and a Location header pointing at it. piece_ids lists a tracking number for each piece. approximate_position is true when the address could only be placed roughly, which is worth showing to whoever placed the order, and flagged is true when the address is outside every coverage area and has been marked for your team to check. Prices come as net, tax and total, with tax_rate and tax_name, the name of the tax where you operate. The booking then appears in the console, is announced to webhooks and, where messages are switched on, to the recipient.
To show a price before booking, POST /api/v1/rates/quote takes the service, the weight and the destination: an address object, a postal code with its country, or a position. It returns the price line by line with net, tax and total, whether the address is covered and can be booked, and the window a booking made now would be promised. Nothing is stored.
To check an address before anyone books, GET /api/v1/coverage/check takes it as one line of text in q, as address fields, or as latitude and longitude. It answers whether the address is covered, whether a booking there would be accepted, flagged for your team or refused, its price band and the services offered there. Keys tied to one sender may call it. GET /api/v1/locations lists your open locations with their addresses and positions; it covers the whole company, so keys tied to one sender are refused.
To cancel, POST /api/v1/shipments/{id}/cancel with no body. It works until the parcel goes out for delivery. Cancelling a shipment that is already cancelled answers 200 with the shipment unchanged, so the call is safe to repeat.
Reading
Read, list and page
GET /api/v1/shipments/{id} returns one shipment in full: its state, the timeline of events, the price breakdown, the run and vehicle carrying it and, once there is one, the proof of delivery. Add ?include=proof_images to receive the signature and photo themselves. They are left out by default because they are large.
GET /api/v1/shipments returns the same list the console shows. Filter it with state (all, moving, out, delivered, attention or returned), service, hub, route, sender, a free-text q, and days for how far back finished deliveries are included.
Pagination. limit sets the page size, from 1 to 100, and is 25 if you leave it out. When meta.has_more is true, pass meta.next_cursor as cursor to get the next page. A cursor is valid for 15 minutes. The pages of one walk are pinned to the moment in meta.as_of.
Tracking numbers in a path are forgiving: case, spaces and dashes do not matter. Times in answers are ISO 8601 in UTC.
curl https://deliverysystem-zeta.vercel.app/api/v1/track/TRACKING_NUMBER// Walk every page of a list. Needs Node 18 or later.
let cursor = null;
while (true) {
const url = new URL("https://deliverysystem-zeta.vercel.app/api/v1/shipments");
url.searchParams.set("limit", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.DELIVERY_API_KEY}` },
});
if (res.status === 429) {
const wait = Number(res.headers.get("Retry-After") ?? 1);
await new Promise((done) => setTimeout(done, wait * 1000));
continue;
}
const payload = await res.json();
if (!res.ok) throw new Error(`${payload.error.code}: ${payload.error.message}`);
for (const shipment of payload.data) console.log(shipment.id, shipment.status);
if (!payload.meta.has_more) break;
cursor = payload.meta.next_cursor;
}{
"data": [
"25 shipments"
],
"meta": {
"generated_at": "2026-12-02T10:30:00.000Z",
"total": 132,
"count": 25,
"has_more": true,
"next_cursor": "OPAQUE_VALUE",
"as_of": "2026-12-02T10:30:00.000Z"
}
}Idempotency
Retry a booking without booking twice
Networks drop answers. If a booking request times out, you cannot know whether it was made. Send an Idempotency-Key header with every booking: 1 to 120 printable characters with no spaces. Your own order id is a good choice. Then a retry is always safe.
Keys are remembered for 24 hours, separately for each API key.
| What you send | What you get |
|---|---|
| A new key | The booking is made and the answer is remembered. |
| The same key and the same body, within 24 hours | The first answer again, with the header Idempotent-Replayed: true. Nothing is booked twice. |
| The same key with a different body | 422 idempotency_key_reused. Use a new key for a new request. |
| The same key while the first request is still running | 409 request_in_progress. Try again in a moment. |
| The same key after the first request failed | The request runs again. Failed attempts are forgotten, so they can be corrected and retried. |
Errors and limits
One shape for every answer
A successful answer wraps the result in data, with a meta object that always carries generated_at. An error is an error object with a stable code to branch on and a message written for people. Validation errors add fields, naming each field and what is wrong with it.
{
"error": {
"code": "validation_failed",
"message": "recipient.name is required.",
"fields": [
{
"field": "recipient.name",
"message": "recipient.name is required."
}
]
}
}Rate limits. Each key may make 120 requests in any 60 seconds. Requests without a key are limited to 60 a minute from one address. Every answer carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset, and a 429 adds Retry-After in seconds.
Request bodies are limited to 64 KB. Every answer names the API version in a YallaRoute-Version header, currently 2026-12-01.
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_json | The body is not valid JSON, or is not a JSON object. |
| 400 | invalid_parameter | A query parameter is outside its vocabulary or range. error.param names it. |
| 400 | invalid_cursor | The cursor is not one this API issued, or is more than 15 minutes old. |
| 400 | date_out_of_range | The date asked for is in the future. |
| 400 | invalid_idempotency_key | Idempotency-Key must be 1 to 120 printable characters with no spaces. |
| 400 | limit | A fixed limit has been reached, such as 20 webhook endpoints. |
| 401 | missing_key | No Authorization: Bearer header was sent. |
| 401 | invalid_key | The key is not valid or has been revoked. |
| 402 | plan_feature | The company's plan does not include what was asked for, such as cash on delivery or webhooks. error.feature names it and error.plan names the plan. |
| 402 | plan_limit | What the company's plan includes is used up, such as its deliveries for the month. error.limit names it and error.plan names the plan. |
| 403 | insufficient_scope | The key's scope is too low. error.required_scope names the one needed. |
| 403 | workspace_suspended | The company's workspace is suspended, so its keys are refused until it is restored. |
| 403 | forbidden | A key that belongs to one sender asked for another sender's data, or for something company-wide. |
| 404 | not_found | Nothing has that id, or it belongs to a sender this key cannot see. |
| 404 | unknown_endpoint | The path is not an endpoint of this API. |
| 409 | not_cancellable | The shipment is out for delivery or finished. error.status says which. |
| 409 | request_in_progress | The first request with this Idempotency-Key is still being handled. |
| 413 | payload_too_large | The request body is larger than 64 KB. |
| 422 | validation_failed | One or more fields are wrong, or an address cannot be booked. error.fields lists each one as { field, code, message }. |
| 422 | idempotency_key_reused | The Idempotency-Key was already used with a different body. |
| 429 | rate_limited | Too many requests in the last minute. Retry-After says how many seconds to wait. |
| 429 | too_many_attempts | One address has sent more than 30 requests with a key that is not valid in a minute. |
| 500 | server_error | Something failed on our side. The request can be retried. |
Field codes. Each entry in error.fields of a 422 validation_failed answer has a field, a code to branch on and a message for people. New codes may be added, so treat a code you do not know like invalid.
| Code | Meaning |
|---|---|
required | The field is missing. |
invalid | The field is not in the form it should be: a number, a date, true or false, a country code, or one of a list. |
unknown | The id does not name an open record of this company, such as a closed sender account. |
mismatch | Two fields disagree, such as a price band that is not the address's own. |
too_heavy | Heavier than the heaviest single parcel the company takes. |
too_long | The longest side is over the company's limit. |
too_large | Length plus girth is over the company's limit. |
too_many | More parcels than one booking can hold. |
too_high | An amount is over the company's limit, which the message gives in the company's currency. |
not_offered | The company does not offer this, such as cash on delivery. |
address_not_found | The address could not be found. Check it, or send latitude and longitude. |
address_lookup_unavailable | The address search did not answer. Try again in a moment, or send latitude and longitude. |
outside_coverage | The company does not take bookings for that address. |
Webhooks
Be told, instead of asking
Register an HTTPS address and choose the events you want. Each time one happens, a signed JSON message is posted to it.
Events
Shipments
- shipment.createdA delivery is booked in the console, the sender portal or through the API.
- shipment.collectedThe parcel is scanned as collected from the sender.
- shipment.at_hubThe parcel is scanned in at one of the company's locations.
- shipment.out_for_deliveryThe driver starts the run that carries the parcel.
- shipment.nearbyThe vehicle's reported position comes close to the delivery address.
- shipment.deliveredThe driver records proof of delivery.
- shipment.failedThe driver records that the delivery could not be made.
- shipment.rescheduledStaff or the recipient move the delivery to another window.
- shipment.returnedA return to sender is arranged.
- shipment.cancelledThe booking is cancelled before the parcel goes out.
Runs
- run.startedA driver sets off on a run from its location.
- run.finishedA run is closed with the driver back at its location. Anything not delivered is checked back in.
Exceptions
- exception.openedSomething needs a person's attention, such as a failed delivery. Other kinds carry the location, run, vehicle or driver concerned instead of a shipment.
- exception.resolvedA member of staff resolves an exception.
Money and returns
- cod.collectedA driver takes payment at the door.
- return.requestedA return is requested for a delivered parcel, by staff, the sender or the recipient.
- invoice.issuedAn invoice is issued to a sender account.
Subscribe to * to receive every event. An endpoint that belongs to one customer account hears only about that account's deliveries.
Add an endpoint
Add one on the Developers screen, or with POST /api/v1/webhooks and an admin key. The address must be https. The answer carries the signing secret, which begins whsec_. Store it straight away; on the Developers screen an owner can show it again, and each time is recorded in the audit log. A company can have up to 20 endpoints.
curl -X POST "https://deliverysystem-zeta.vercel.app/api/v1/webhooks" \
-H "Authorization: Bearer $DELIVERY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/hooks/deliveries", "events": ["shipment.out_for_delivery", "shipment.delivered", "shipment.failed"]}'What arrives
A POST with a JSON body. In the current format, 2026-12-01, the body holds api_version, the event's id and type, a created time, company (your workspace), test and a data object shaped exactly like the REST answers: for a shipment event, the shipment as GET /api/v1/shipments/{id} returns it. These headers describe it:
- X-YallaRoute-Event
- The event type, for routing before you parse the body.
- X-YallaRoute-Delivery
- The number of this delivery attempt record, as shown on the Developers screen.
- X-YallaRoute-Signature
- t=<unix ms>,v1=<hex>: the timestamp and the signature.
- X-YallaRoute-Version
- The body format, on endpoints that receive the current one.
Answering, retries and duplicates
Answer with any 2xx status within six seconds. Anything else is tried again after 30 seconds, 2 minutes, 10 minutes and an hour, and is then marked as failed. Each attempt, with how your endpoint answered, is listed on the Developers screen.
Treat the id in the body as the identity of an event and ignore one you have already handled. A retry can arrive after a later event, so do not rely on order: read the shipment again if you need its current state.
In the current format the body uses the same snake_case names and ISO 8601 times as the REST answers, so one set of types reads both. Each endpoint receives one body. A new endpoint gets the current one unless format asks for the earlier body, which has camelCase names and times in milliseconds since 1970; endpoints added before the current format keep the earlier body until someone switches them on the Developers screen, in the console or the customer portal.
{
"api_version": "2026-12-01",
"id": "evt_1042",
"type": "shipment.delivered",
"created": "2026-12-02T14:30:00.000Z",
"company": "your-company",
"test": false,
"data": {
"id": "DL-TEST-0001",
"status": "delivered",
"status_label": "Delivered",
"order_ref": "ORDER-1001",
"service": {
"id": "nextday",
"name": "Next Day"
},
"address": {
"line1": "1 Example Street",
"line2": null,
"city": null,
"region": null,
"postal_code": null,
"country": null,
"latitude": null,
"longitude": null
},
"window": {
"start": "2026-12-01T13:30:00.000Z",
"end": "2026-12-01T15:30:00.000Z"
},
"completed_at": "2026-12-01T14:30:00.000Z",
"currency": "USD",
"price": 10.5,
"price_net": 10.5,
"tax": 0,
"tax_rate": 0,
"tax_name": "Tax",
"tracking_url": "https://your-site.example.com/track/DL-TEST-0001",
"proof_of_delivery": {
"method": "Signed for",
"received_by": "Test Recipient",
"at": "2026-12-01T14:30:00.000Z",
"lat": null,
"lng": null,
"gps_accuracy_m": null,
"has_signature": true,
"has_photo": false,
"handover_code_matched": null,
"age_checked": false,
"notes": null
}
}
}Signature verification
Verify every webhook with HMAC-SHA256
- Read the raw request body exactly as it arrived, before any JSON parsing.
- Split the X-YallaRoute-Signature header on the comma into t and v1.
- Build the signed string: the value of t, a full stop, then the raw body.
- Compute HMAC-SHA256 of that string with the signing secret of the endpoint, as lowercase hex.
- Compare the result with v1 using a constant-time comparison.
- Reject the request if t, a Unix time in milliseconds, is more than five minutes from your clock.
The signature check stops anyone who finds your address from posting made-up events. The timestamp check stops a genuine request being captured and sent again later.
import { createHmac, timingSafeEqual } from "node:crypto";
// header: X-YallaRoute-Signature: t=<unix ms>,v1=<hex>
export function verify(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const expected = createHmac("sha256", secret).update(`${parts.t}.${rawBody}`).digest("hex");
const fresh = Math.abs(Date.now() - Number(parts.t)) < 5 * 60 * 1000;
return fresh && expected.length === parts.v1.length && timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}Questions
Developer questions
Which plans include the API and webhooks?
API keys are included in Growth, Scale and Enterprise, and webhooks in Growth, Scale and Enterprise. A request for something the plan does not include is refused with 402 plan_feature, and one past a limit of the plan, such as its deliveries for the month, with 402 plan_limit. Keys are kept when a plan changes: they work again once the plan includes the API. A new workspace has the Scale features for 14 days.
Do I need a key to track a parcel?
No. GET /api/v1/track/{id} answers without a key and returns only what is safe to show to anyone holding the tracking number: the status, the promised window, the timeline and a short proof of delivery summary. It is limited to 60 requests a minute from one address.
Is there a sandbox or a test mode?
No. There is one environment, and every key begins ks_live_. Test in a trial workspace: give test bookings an order reference you can recognise and cancel them afterwards. The Developers screen can send a sample event to a webhook endpoint, so you can test your receiver without a real delivery.
Is there an SDK?
No. The API is plain JSON over HTTPS, so any HTTP client works. The console inside the Developers screen writes the request you are trying as curl, JavaScript or Python that you can copy.
How do I stop a retry booking a delivery twice?
Send an Idempotency-Key header with each booking, for example your own order id. A repeat with the same key and the same body within 24 hours gets the first answer back, marked Idempotent-Replayed: true. The same key with a different body is refused.
How do I know a webhook is genuine?
Check the X-YallaRoute-Signature header. It holds a timestamp and an HMAC-SHA256 signature of the timestamp and the raw body, made with the signing secret of your endpoint. Recompute it, compare in constant time and reject anything more than five minutes old.
Can my customers have their own API keys?
Yes. A key can be tied to one customer account, and then it can only see and book that customer's deliveries. You can create such a key for them in the console, or they can create their own in the customer portal once you have given them portal access.
Next
Step-by-step help, guides and the product
Step-by-step help
- Create an API keyHelp article
- API key scopes and sender-bound keysHelp article
- Make your first API requestHelp article
- Book deliveries through the APIHelp article
- Receive events with webhooksHelp article
- Verify webhook signaturesHelp article
- API errors and rate limitsHelp article
- Idempotency keys and safe retriesHelp article
- Read the request log and webhook deliveriesHelp article
- Let your senders connect their own systemsHelp article
- Webhooks are not arrivingHelp article
Guides
Around the API
- API and webhooksCreate and follow deliveries from your own systems, and receive signed events as they happen.
- Sender portalBusiness customers book, import, print labels, follow deliveries and get invoices without calling you.
- NotificationsBooked, on its way, nearby, delivered: messages in your words, on the channels you connect.
- Order import and API bookingsFile uploads checked row by row, and a REST API with signed webhooks.
- Security overviewHow workspace data is kept separate and protected
- System statusA live check of the service
- Plans and pricingWhich plans include the API and webhooks
- Acceptable useThe rules for keys, limits and webhooks
Build against a real workspace
Open a workspace, create a key and try each endpoint from the console inside it. A new workspace has the Scale features for 14 days, the API and webhooks included.