Errors
Every Roots API error is an RFC 9457 problem+json document with a stable machine-readable code.
Every error response is an RFC 9457 problem document, sent with Content-Type: application/problem+json. Branch on code, which is stable. detail is written for a person and its wording can change.
Error shape
{
"type": "https://docs.roots.finance/docs/errors#account_has_balance",
"title": "Conflict",
"status": 409,
"detail": "the account still holds a balance; move the funds out before closing it",
"code": "account_has_balance",
"instance": "/api/v1/accounts/acct_1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736"
}| Field | Meaning |
|---|---|
type | A link to the documentation of code. Branch on code, not on this URI's text. |
title | Short summary of the status. |
status | The HTTP status code. |
detail | A sentence for a person to read. |
code | Stable error code. See the table below. |
instance | The path of the request that failed. |
trace_id | The request's trace id. Quote it, with the X-Request-ID response header, when you contact support. Empty when no trace is active. |
violations | Present on 422 with code validation or review_not_ready: every failed field or requirement at once. |
Each violation has a path (for example details.phone or documents.formation), a stable code, and, on field errors, a message:
{
"type": "https://docs.roots.finance/docs/errors#validation",
"title": "Validation Error",
"status": 422,
"detail": "body.amount_minor: Field required",
"code": "validation",
"instance": "/api/v1/transfers",
"trace_id": "4bf92f3577b34da6a3ce929d0e0e4736",
"violations": [
{"path": "amount_minor", "code": "missing", "message": "Field required"}
]
}On 502 and 503, detail carries a reference instead of upstream details. Quote it, together with the X-Request-ID response header, when you contact support.
Error codes
code | HTTP status | Meaning | What to do |
|---|---|---|---|
internal_error | 500 | An unexpected error occurred on Roots' side. | Retry later; quote the X-Request-ID if it persists. |
validation | 400, 422 | A field is missing, malformed, or not acceptable. On 422, violations lists each one; on 400, detail names the problem. | Fix the field and resend. |
review_not_ready | 422 | The person is well-formed but has unmet review requirements, all listed in violations. | Supply every listed requirement, then submit again. |
person_review_not_cleared | 422 | An account can only be opened for a person whose review cleared (status active); this person's review is still in progress or was denied. No account was created. | Wait for person.review.completed with a cleared review, then open the account. |
unauthorized | 401 | The token is missing, expired, or invalid. | Send a valid token. |
permission_denied | 403 | Authenticated, but not permitted to perform this action. | Use a token with the required permission. |
operation_disabled | 403 | Roots has turned this operation off for every client, for example during an incident. | Do not retry automatically. Try again later or contact support. |
maker_checker_violation | 403 | The creator of a transfer cannot approve or reject it. | Have a different user approve or reject. |
not_found | 404 | No such resource or path. Ids of other clients read as this too. | Check the id and the path. |
method_not_allowed | 405 | The path exists but not for this HTTP method. | Use the documented method. |
conflict | 409 | The request conflicts with the resource's current state. | Re-read the resource and decide again. |
illegal_transition | 409 | The resource cannot move from its current status to the requested one. | Check the allowed transitions. |
idempotency_key_conflict | 409 | This Idempotency-Key was already used with a different request body, or by another user or API token of your client. | Use a new key for a new request; resend the identical body for a retry. |
idempotency_key_in_progress | 409 | The first request with this Idempotency-Key has not finished yet. | Wait briefly, then resend the same key and body to receive its response. |
idempotency_key_response_lost | 409 | The first request with this Idempotency-Key was processed, but its response could not be stored. | Read the resource to see the result. Do not resend with a new key, or it may act twice. |
account_not_active | 409 | The account is not active, so it cannot take part in this operation. | Wait for or restore active, or use another account. |
account_not_provisioned | 409 | The account has no bank account number yet. | Retry once the account is active. |
account_has_balance | 409 | The account still holds a balance, holds included, so it cannot be closed. | Move the funds out, then close. |
provisioning_in_progress | 409 | A bank account may still be opening behind this account, so it cannot be closed. | Follow the remedy in detail, or wait for provisioning to finish. |
multi_bank_move_unsupported | 409 | Your money is held at more than one bank, so a move between your revenue, billing balance and fraud reserve cannot run. | Contact Roots to make the move. |
backend_conflict | 409 | The payments backend reports a conflict with an earlier request. | Re-read the transfer, then decide whether to create a new one. |
transfer_not_cancelable | 409 | The transfer can never be cancelled: a deposit, an internal transfer, a wire already sent to the bank, or one the bank has refused to cancel or that has finished. | Do not retry. Read cancelable on the transfer before offering a cancel. |
transfer_cancel_unavailable | 409 | The transfer cannot be cancelled yet: it is still being created or being sent to the bank. | Retry in a few seconds, or wait until cancelable is true. |
insufficient_funds | 422 | The source account's available balance is below the amount. | Fund the account, then create a new transfer with a new Idempotency-Key. |
insufficient_billing_balance | 400 | Your billing balance is below its minimum, so a request that can incur a fee is refused. | Top up your billing balance, or move revenue to billing, then retry. |
customer_fee_not_chargeable | 422 | The fee markup would charge your customer on an event where their account is empty or absent. | Keep the markup at zero for that event, or charge the customer on a deposit instead. |
insufficient_revenue | 400 | The amount to move from revenue to billing exceeds your revenue balance. | Move at most your revenue balance. |
insufficient_fraud_reserve | 400 | Your fraud reserve is below the amount Roots requires, so a request that moves money is refused. | Top up your fraud reserve by at least the shortfall in detail, or move revenue into it, then retry. |
reserve_below_minimum | 400 | The move would take your billing balance or fraud reserve below its minimum. | Move at most the amount above the minimum; detail says how much. |
payload_too_large | 413 | The request body or uploaded file is over the size limit. | Send a smaller one. |
unsupported_media_type | 415 | The uploaded file type is not accepted. | Upload a PDF, PNG, or JPEG. |
rate_limited | 429 | Too many requests from your IP address, or the account or counterparty already has an operation in progress. | Wait Retry-After seconds, then resend with the same Idempotency-Key and body. See Rate limits. |
not_implemented | 501 | This feature is not implemented. | Do not retry. |
rail_not_supported | 501 | The requested payment rail is not supported. | Use a supported rail. |
rail_not_enabled | 409 | Roots supports the requested rail, but it is not enabled for this client. | Use one of the rails enabled for the client, or ask Roots to enable this one. |
backend_unavailable | 502 | The payments backend could not complete the request. | Retry later; quote the reference in detail to support if it persists. |
provider_bank_not_configured | 500 | Roots has not recorded the receiving bank for this account's provider, so the funding details cannot name where a wire should go. | Contact Roots; this is a configuration gap on our side, not something to retry. |
screening_in_progress | 409 | An earlier screening of this person or counterparty has not finished yet, so it can neither be replayed nor run again. | Retry the same request shortly. This is not about the Idempotency-Key you sent. |
service_unavailable | 503 | A service this request depends on is unavailable. | Retry the same request later. |
Errors and transfer outcomes
A transfer that is created and later fails is not an error response. POST /transfers returns 201, and the outcome arrives on the transfer as status, status_detail, and failure. See Track transfer status.
Retry safely
| Status | Retry? |
|---|---|
400, 401, 403, 404, 405, 413, 415, 422 | No. Fix the request first. |
409 | No. Re-read the resource and decide again. idempotency_key_in_progress, transfer_cancel_unavailable and screening_in_progress are the exceptions: resend after a short wait, with the same key and body for idempotency_key_in_progress. |
429, 502, 503 | Yes, after a wait. Reuse the same Idempotency-Key and body. |
500 | Read the resource first: the outcome is unknown. If it did not take effect and the response carries X-Should-Retry: false, retry with a new Idempotency-Key; otherwise reuse the same key and body. |
501 | No. |
A timeout tells you nothing about whether the request took effect. Retry it with the same Idempotency-Key and the identical body; see Idempotency.
Next steps
- Read Idempotency before you retry a create.
- Read Security and data handling for what to keep out of your logs.
Updated 5 days ago