Reference›Errors
Errors
HTTP mapping. A failed webhook delivery is not a 500 on the trip itself.
Key points
- 401 / 403 — Key missing, wrong, or not a client key.
- 409 — Idempotency conflict, or the trip can no longer be changed or cancelled.
- 422 — Validation. Place the error on the field (from_address, vehicle_type, …).
- 429 — Rate limited. Wait for Retry-After, then retry.
- Body — JSON with message. Validation errors add errors{field: [..]}.
Errors are JSON. Every error has a message. Validation errors (422) also list each field under errors. Messages follow Accept-Language (Arabic by default): send Accept-Language: en for English text. Use the status code, not the message text, in your code.
| Status | Meaning | What to do |
|---|---|---|
| 200 / 201 | Success / trip created | Read data |
| 304 | Status unchanged (If-None-Match) | Wait X-Poll-After-Ms, then poll again |
| 400 | Update had no fields | Send at least one field |
| 401 | Key missing, wrong, revoked or expired (key: 3 years, login token: 7 days) | Check the header. Ask TrustCold for a new key, or call POST /login again |
| 403 | The token is not bound to a client, or the account is inactive | Use a client key. Contact TrustCold |
| 404 | Trip does not exist for this client | Check the numeric id. Another client's trip is always 404 |
| 409 | Idempotency conflict, or the trip can no longer be changed / cancelled | Use a new key for a new booking. Re-read the trip |
| 422 | Validation failed | Show errors.<field> next to that field |
| 429 | Rate limited | Wait for Retry-After seconds. Do not retry in a tight loop |
| 5xx | Server error | Retry with the same Idempotency-Key. A failed webhook is never a 5xx on the trip |
Examples
Missing, wrong or expired key
{
"message": "Unauthenticated."
}Validation failed
{
"message": "The trip date field is required.",
"errors": {
"trip_date": ["The trip date field is required."]
}
}Conflict
{
"message": "This trip can no longer be changed."
}Rate limited (see the Retry-After header)
{
"message": "Too Many Attempts."
}