Errors
Every error has a stable code and a readable message.
Errors return JSON with a stable code you can branch on and a message written for people:
{ "error": { "code": "unauthorized", "message": "missing or invalid API key", "request_id": "req_..." } }Status | Code | What to do |
|---|---|---|
400 |
| Fix the request body or query; the message names the field. |
401 |
| The API key is missing, wrong or revoked. |
402 |
| You've used this month's trackings. Upgrade, or wait for the next month. |
404 |
| No tracking, webhook or key with that id on your account. |
409 |
| A create with this |
422 |
| We don't track that carrier yet. We record the request, and it moves that carrier up our build queue. |
422 |
| We can't tell the carrier from the number alone. Send |
422 |
| This |
429 |
| Too many requests. Wait for the |
Anything in the 5xx range is on our side: retry with backoff, and include the request_id if you contact us.
Retrying a create safely
Send an Idempotency-Key header on POST /v1/trackings (a UUID, or your own order id). For 24 hours, a retry with the same key and body returns the tracking the first request created, with Idempotent-Replayed: true, instead of adding a second one:
curl -X POST https://api.trackified.15-204-158-166.sslip.io/v1/trackings \
-H "Authorization: Bearer $TRACKIFIED_KEY" \
-H "Idempotency-Key: order_1042" \
-H "Content-Type: application/json" \
-d '{"tracking_number": "1Z999AA10123456784", "custom_id": "order_1042"}'Without a key, find what a timed-out request made by your own reference: GET /v1/trackings?custom_id=order_1042 (or ?tracking_number=…).
Watching your quota
GET /v1/account/usage returns trackings_used, trackings_limit and trackings_remaining for the current month (UTC), with period_end saying when it resets. Check it before a create fails with 402 quota_exceeded.