Shipping API
Shipping built into your software
The same rating, label and tracking engine behind our app, as a plain REST API: bearer keys with per-key permissions, idempotent purchases and JSON errors you can act on. Included on the Scale and Reseller plans.
curl https://lastmilelabels.com/api/v1/labels \
-H "Authorization: Bearer lml_live_..." \
-H "Idempotency-Key: order-10482" \
-H "Content-Type: application/json" \
-d '{
"order_id": "6f1c0c1e-...-2b7a",
"service": "usps_ground_advantage",
"ship_date": "2026-10-14",
"options": { "confirmation": "signature" }
}'{
"object": "label",
"id": "9c2f...",
"status": "purchased",
"carrier": "usps",
"service": "usps_ground_advantage",
"tracking_number": "9400111206213000000000",
"tracking_url": "https://lastmilelabels.com/track/9400111206213000000000",
"label_url": "https://lastmilelabels.com/api/v1/labels/9c2f.../file",
"price": { "amount": "8.47", "amount_cents": 847, "currency": "USD" },
"estimated_delivery_at": null,
"ship_date": "2026-10-14"
}Reference
Everything the app can do, you can do
Base URL https://lastmilelabels.com/api/v1. Send Authorization: Bearer lml_live_… on every request. Bodies and responses are JSON in snake_case; money is a string in USD with the cents alongside.
| Endpoint | Permission | What it does |
|---|---|---|
| GET/account | any | The account behind the key, its plan and wallet balance. Use it to check a key works. |
| GET · PATCH/account/settings | labels | Read or change whether we email recipients. White-label integrations switch both flags off so no email leaves us. |
| POST/addresses/validate | rates | Standardize a US address with ZIP+4 and learn whether it is deliverable, with the carrier's messages when it is not. |
| GET · POST · DELETE/warehouses | orders | Saved ship-from addresses with a warehouse_id, for integrations that ship from a fixed set of places. |
| POST/rates | rates | One-shot rates for a ship-to and parcel without creating an order. Send the ship-from as a from object or a warehouse_id. |
| POST/orders | orders | Create an order to ship: recipient, parcel, optional line items, your own order number and a from object that prints as the return address. validate: true checks the addresses first. |
| GET/orders · /orders/{id} | orders | List orders by status or search, or fetch one with its items. |
| GET/orders/{id}/rates | rates | Rates for an order, cheapest first, served from the cached quote while nothing that moves the price has changed. Pass ship_date, confirmation and insured_cents. |
| POST/labels | labels | Buy a label for an order with an Idempotency-Key so retries never buy twice. The wallet is charged; the label file and tracking number come back. |
| GET/labels · /labels/{id} · /labels/{id}/file | labels | List labels, fetch one with its scan events, or download the PDF. |
| POST/labels/{id}/void | labels | Void a label. The wallet is refunded when the carrier confirms; the label's refund field and status follow the carrier's decision. |
| GET/tracking/{number} | tracking | Normalised tracking for one of your labels: preparing, in transit, delivered, voided, with the carrier's scan events. |
Errors
Every error is { error: { code, message } }: 401 for a bad key, 402 when the wallet is short, 403 for a missing permission or plan, 409 for a repeated order number, 422 with a fields map for validation, 429 past 300 requests a minute.
Options
confirmation is none, signature or adult_signature; insured_cents is carrier insurance up to $5,000. Options a carrier does not sell are dropped for that carrier and priced into the rate for the others.
Idempotency
Send Idempotency-Key on POST /labels. A retry with the same key returns the label already bought instead of buying another. Without it, the same purchase on the same order is still deduplicated.
Designed for production
Boring in the best way
- Keys are shown once, stored hashed, and revocable from Settings in one click
- Test keys (lml_test_) run against the carrier sandbox: real request shapes, sample labels, nothing charged
- Per-key permissions: rates, orders, labels, tracking
- Idempotent label purchases, so retries are safe
- Per-key rate limits with retry-after
- Our field names, not the carrier's, so a carrier change never breaks you
- The same wallet, pricing and tracking as the app, so what you see in the dashboard is what the API did
On the roadmap: webhooks for tracking events, return labels and SCAN forms. Tell us what you need first.
3PLs and resellers
Ship for your own customers
For 3PLs, marketplaces and software platforms. One account, one prepaid wallet, as many keys as you have systems. Volume pricing as you grow, with your margin set per account by our team.
- Separate keys per warehouse or client system, each with its own permissions
- Every label in one ledger, exportable monthly
- White-label tracking pages and notifications
- Volume pricing as you grow
- Onboarding handled with you