iBOX API

Building reliably

Errors and rate limits

Every error has the same shape, and a code that does not change.

Errors follow RFC 9457 (problem details). Branch on code, which is stable; the title is for people and may be reworded. Field problems are listed in errors, each with the field's name.

json
{
  "type": "https://api.iboxdelivery.com/docs/errors#validation_failed",
  "title": "Request body failed validation",
  "status": 422,
  "code": "validation_failed",
  "errors": [
    { "field": "recipient_phone", "code": "too_small", "message": "Too small: expected string to have >=5 characters" }
  ],
  "correlation_id": "c7e1d0a4-2f0b-4b8e-9d55-1a1b2c3d4e5f"
}

Every error also carries an X-Correlation-Id header with the same value. Quote it when you contact us and we can find the request.

Codes

StatusCodeMeaning
400invalid_jsonThe body is not valid JSON.
400idempotency_key_too_longIdempotency-Key is over 255 characters.
401unauthorizedThe API key is missing, malformed, unknown or revoked.
404shipment_not_foundNo parcel of yours has that id.
404not_foundNo parcel of yours has that tracking number.
409not_bookedA label was asked for a parcel that is not booked, for example a cancelled one.
422validation_failedA field is missing or wrong. errors[] names each one.
422parcel_does_not_fitNo compartment takes a parcel this big or this heavy. See Parcel sizing.
422unknown_stationNo active station has that id.
422station_unavailableThe station has no locker cabinet yet.
422idempotency_key_reusedThis Idempotency-Key was used for a different request.
429rate_limit.exceededToo many requests. Wait for Retry-After seconds.

Rate limits

Each API key may make 100 requests per minute, counted over a sliding window. Past that, requests answer 429 with a Retry-After header in seconds, and X-RateLimit-Limit and X-RateLimit-Remaining. Refused requests count too, so wait for Retry-After rather than retrying at once.

Retrying

  • 429 and 5xx are worth retrying, with a growing pause. Bookings are safe to retry with an Idempotency-Key.
  • Other 4xx will fail the same way until the request changes.