Skip to main content

Response format

Success responses

Successful requests return a JSON object with the following shape:

Error responses

Failed requests return a JSON object with the following shape:

Field-level validation errors

When a request fails validation, the response returns 422, a message of validation errors, and one entry in errors per problem:
A single bad field can produce several entries. Omitting both amount and cryptoAmount, for example, returns eight, because every rule on both fields reports separately. Read the first entry for the actionable message.
Not all error responses include every field. See the exceptions for 429 and 500 below.

Common error scenarios

400 - Bad request

Returned when the request is invalid or violates a business rule. Duplicate wallet label:
This occurs when you attempt to generate a wallet address with a label that already exists for the same asset.

401 - Unauthorized

Returned when authentication credentials are missing or invalid. Ensure you are sending the correct x-app-id and x-app-secret headers, and that the X-Breet-Env header is set to either sandbox or production. See the quickstart for how to obtain and configure your credentials.

403 - Forbidden

Returned when your account does not have permission to perform the requested action.

404 - Not found

Returned when the requested resource does not exist. Wallet not found:
Transaction not found:

409 - Conflict

Returned when the request conflicts with the current state of a resource, such as attempting to create a resource that already exists.

422 - Unprocessable entity

Returned when the request is well-formed but cannot be processed due to a validation or business logic constraint.
This commonly occurs when enabling auto-settlement on a wallet that doesn’t have a linked bank account.

429 - Too many requests

Returned when you exceed the rate limit. Back off and retry after the time indicated in the Retry-After response header (value in seconds).
The 429 response body does not follow the standard error shape. It only returns a message field:
Your error handling should account for this exception.

500 - Internal server error

Returned when an unexpected error occurs on the server. The response body includes success, message, meta, and errors, but does not include a data field:
For 500 errors, implement retry logic with exponential backoff.

Withdrawal errors

Errors you are most likely to meet on POST /payments/withdraw/address and POST /payments/estimate-network-fee. None of these debit your balance or create a withdrawal.

Request shape

Returned as 422 with the message in errors.

Limits and availability

Returned as 403.

Balance and duplicates

Returned as 400.

Temporary payout capacity

Returned as 400, on both the withdrawal and the fee estimate endpoints.
Breet cannot price a payout of that size in that coin right now. Nothing is debited. Retry with a smaller amount, or try again later — this is a Breet-side limit, not a problem with your request or your balance.

Best practices

  • Always check the success field before processing the response.
  • Use the message field for logging and debugging. Do not rely on exact message text for control flow, as messages may change.
  • Handle 4xx errors gracefully in your application with appropriate user feedback.
  • For 429 errors, read the Retry-After header to determine how long to wait before retrying.
  • For 5xx errors, implement retry logic with exponential backoff.