Skip to main content
Paxos API errors follow RFC 7807 Problem Details. The SDK parses these into typed errors so you can handle specific failure cases without inspecting raw HTTP status codes.

Error Format

All Paxos API errors return a JSON body with these fields:
{
  "type": "https://docs.paxos.com/problems/not-found",
  "title": "Not Found",
  "status": 404,
  "detail": "transfer with id 'abc' not found",
  "instance": "/transfer/transfers/abc",
  "request_id": "req_01HX..."
}
FieldDescription
typeURI identifying the error type
titleShort human-readable summary
statusHTTP status code
detailLonger explanation of what went wrong
instanceThe request path that caused the error
request_idUnique ID for this request — include this in support tickets

Typed Errors

The SDK maps HTTP status codes to typed errors:
HTTP StatusError TypeHelper
400ValidationErrorIsValidationError()
401UnauthorizedErrorIsUnauthorized()
403ForbiddenErrorIsForbidden()
404NotFoundErrorIsNotFound()
409ConflictErrorIsConflict()
422UnprocessableErrorIsUnprocessable()
429RateLimitErrorIsRateLimited()
5xxServerErrorIsServerError()

Handling Errors

transfer, err := client.Transfers.GetTransfer(ctx, "txn_123")
if err != nil {
    if paxos.IsNotFound(err) {
        fmt.Println("Transfer not found")
        return
    }

    var apiErr *paxos.APIError
    if errors.As(err, &apiErr) {
        fmt.Printf("API error: %s (request_id: %s)\n", apiErr.Detail, apiErr.RequestID)
    }

    return err
}

Common Errors and Fixes

ErrorStatusCommon CauseFix
NotFoundError404Wrong ID or resource doesn’t existVerify the ID; use List endpoints to discover valid IDs
UnauthorizedError401Bad credentialsVerify client_id and client_secret; check you are using the correct environment
ForbiddenError403Missing OAuth2 scopeAdd the required scope to your API credentials in the Dashboard
ValidationError400Invalid request bodyCheck required fields and field types in the API Reference
RateLimitError429Too many requestsReduce concurrency; the SDK retries automatically with backoff
ServerError5xxPaxos-side issueThe SDK retries automatically; if the issue persists, contact Support

Extracting Request ID

Always include the request_id when contacting support. Every error carries it:
var apiErr *paxos.APIError
if errors.As(err, &apiErr) {
    log.Printf("Include this in your support ticket: %s", apiErr.RequestID)
}

Retry Behavior

The SDK automatically retries requests that fail with 429 (rate limit) or 5xx (server error):
  • Up to 3 retries with exponential backoff
  • Initial delay of 500ms, doubling each attempt (with jitter)
  • Maximum backoff of 30 seconds
  • Retry-After headers are respected when present
Retries are transparent — you only see the final result or error. Client errors (400, 403, 404) are never retried since they require a code change to fix.