Error Handling
All errors follow a consistent envelope format with a machine-readable tag and actionable guidance.
Error response format
{
"_tag": "ParseError",
"type": "ParseError",
"message": "Failed to parse QR code: invalid checksum",
"docs_url": "https://docs.borderli.dev/errors/ParseError",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
| Field |
Description |
_tag |
Machine-readable error type (use this for programmatic handling) |
message |
Human-readable description |
docs_url |
Link to detailed error documentation |
request_id |
Unique request ID for support correlation |
Error types
Retry guidance
- 4xx errors (except 409 and 429): Do not retry. Fix the request.
- 409 IdempotencyInProgress: The original request is still processing. Retry the same request (same key) after a short delay.
- 429 RateLimitError: Wait for
retryAfter seconds, then retry.
- 5xx errors: Retry with exponential backoff. Use the same idempotency key.
- InstructionExpired / FxQuoteExpired: Re-resolve the QR code to get a fresh instruction.
- AmountRequired: The QR is open-amount. Retry with an
amount (minor units).