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 returns422, 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.Common error scenarios
400 - Bad request
Returned when the request is invalid or violates a business rule. Duplicate wallet label:401 - Unauthorized
Returned when authentication credentials are missing or invalid. Ensure you are sending the correctx-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: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.429 - Too many requests
Returned when you exceed the rate limit. Back off and retry after the time indicated in theRetry-After response header (value in seconds).
The 429 response body does not follow the standard error shape. It only returns a Your error handling should account for this exception.
message field:500 - Internal server error
Returned when an unexpected error occurs on the server. The response body includessuccess, message, meta, and errors, but does not include a data field:
Withdrawal errors
Errors you are most likely to meet onPOST /payments/withdraw/address and POST /payments/estimate-network-fee. None of these debit your balance or create a withdrawal.
Request shape
Returned as422 with the message in errors.
Limits and availability
Returned as403.
Balance and duplicates
Returned as400.
Temporary payout capacity
Returned as400, on both the withdrawal and the fee estimate endpoints.
Best practices
- Always check the
successfield before processing the response. - Use the
messagefield for logging and debugging. Do not rely on exact message text for control flow, as messages may change. - Handle
4xxerrors gracefully in your application with appropriate user feedback. - For
429errors, read theRetry-Afterheader to determine how long to wait before retrying. - For
5xxerrors, implement retry logic with exponential backoff.