Errors
FastPay uses ordinary HTTP status codes, and every error has the same JSON shape.
Error format#
422Validation error
{
"error": {
"code": "validation_failed",
"message": "Amount must be at least 1.",
"fields": [{ "field": "amount_minor", "message": "Must be at least 1." }]
},
"request_id": "01a177b9-1822-7a41-b8d9-119d16df9ecc"
}code: a stable word to branch on in your code.message: a sentence for people. Do not parse it.fields: for validation errors, which fields were wrong and why.request_id: quote this when you contact support.
Error codes#
- 400
malformed_requestThe request body could not be read. - 400
validation_failedThe request does not match the API: a required field is missing or a value has the wrong form. The message names the field. - 401
unauthenticatedThe secret key is missing, invalid or revoked. - 403
permission_deniedThe key is not allowed to do this, or the request came from an address that is not on its allowlist. - 403
business_verification_requiredYour business has to be verified before this can be done. - 404
not_foundThat record does not exist for this business and mode. - 409
conflictThe request clashes with the current state, such as a reference reused with different details. - 409
idempotency_key_reusedThat idempotency key was already used with a different request. - 409
provider_profile_requiredYour business has no active provider profile for virtual accounts in this mode, or the provider connection its profile uses is not enabled. - 409
settlement_destination_unconfirmedUnder a FastPay-managed profile, live accounts are not available on that provider yet, or the profile has not been confirmed to pay your own settlement account. - 409
virtual_account_existsThe customer already has an open static account with that provider. - 413
payload_too_largeThe request body is too large. - 422
validation_failedThe request is well formed but cannot be served as sent, such as a field the chosen provider needs. The fields list says which, when a field is the cause. - 429
rate_limitedToo many requests. Wait for the time in the Retry-After header. - 500
internal_errorSomething went wrong on our side. Retry, and quote the request_id if it keeps happening. - 502
provider_unavailableThe provider returned an account FastPay cannot use. No account was opened, and the one started is marked failed: retry with the same idempotency key. - 503
service_unavailableFastPay is briefly unable to answer. Retry shortly. - 503
provider_unavailableThat provider cannot open virtual accounts right now, or could not be asked to. No account was opened, and any account started is marked failed: retry later with the same idempotency key.
Which errors to retry#
Retry 429, 500, 502 and 503, waiting longer each time. Do not retry other 4xx errors: the request itself has to change. When you retry a request that creates something, send the same idempotency key or reference.