Changelog
The first release of the LastMile Public API, under /api/public/v1.
Authentication
- API key and secret (
X-API-Key,X-API-Secret) with eight scopes:shipments:read,shipments:write,merchants:read,merchants:write,geography:read,pricing:read,branches:read,webhooks:manage. - Username and password sign-in with
POST /auth/login, single-use refresh tokens withPOST /auth/refresh, and merchant logins that see only their own data. GET /auth/meto inspect the current credential.
Shipments
- Create (for a merchant or a custom sender), list, get, track, update, cancel and print the label, plus the status catalogue.
- Delivery, exchange and return service types;
standard,expressandsameDaytiers. - Optional
Idempotency-Keyon creates, with replay for 24 hours.
Places
- Countries, cities and districts by id, code or name in Arabic or English, with tolerant matching and "did you mean" candidates.
GET /geography/resolveto validate an address and the coverage endpoints for the cities the company serves.
Merchants, pricing, branches and webhooks
- Merchants and their saved pickup addresses, with duplicate detection.
POST /pricing/quotewith adeliverableflag and a price breakdown.- Branches (read only).
- Per-merchant webhook subscriptions signed with HMAC-SHA256, with test deliveries, secret rotation and automatic retries.
Platform
- One error envelope for every non-2xx response, stable error codes, and a generated OpenAPI 3 document served at
/api/public/v1/openapi.json. - Two-stage rate limiting: per client IP before authentication (600 requests per minute by default, IPv6 grouped by /64) and per verified caller after it (120 per minute by default).
- A request that sends both a bearer token and an API key is refused with
400 ambiguous_credentials. - The company's suspended or expired state (
tenant_blocked) is enforced on every request. - Exact dashboard permissions for password logins on shipment writes (
orders:create,orders:update,orders:cancel); an API key cannot be created with scopes beyond its creator's own permissions. - Upper bounds on weight, dimensions, pieces, declared value and COD.
- Places accept an id, a code or a name everywhere, and a shipment update may change only the district.