Overview
Astra reports a failed request with an HTTP status code and, in most cases, a JSON body. Always branch on the HTTP status first. The body comes in several shapes, described in Response shapes, so parse it defensively.
Some failures happen after a request succeeds. A transfer can be accepted (201) and later move to failed because a card network declined the OCT, a real-time payment could not be delivered, or a bank returned an ACH debit. Those failures arrive on the Transfer and through webhooks, not as HTTP errors. See OCT and card network failures.
| Where the failure shows up | When | What to read |
|---|---|---|
HTTP 4xx response | Immediately; the request was rejected | HTTP status, name, description, embedded_error.code |
HTTP 5xx response | Immediately; the outcome may be unknown | HTTP status, Request-Id header |
Transfer status: failed | Seconds (OCT, real-time) to days (ACH return) after a 201 | failure_reason on the Transfer |
Hosts
| Environment | General host | Secure host |
|---|---|---|
| Production | https://api.astra.finance | https://secure.api.astra.finance |
| Sandbox | https://api-sandbox.astra.finance | https://secure.api-sandbox.astra.finance |
Use the secure host for cards and account creationCall
POST /v1/cardsandPOST /v1/accounts/createon the secure host. Sent to the general host, they are blocked at the network edge with an HTML403page that has noRequest-Id.
Response shapes
Errors produced by the API are JSON. Errors produced at the network edge (Cloudflare or the gateway) may be HTML and carry no Request-Id. Check Content-Type before parsing, and treat a body you can't parse as an unknown error with the HTTP status as your only signal.
The API uses these body shapes. The status is called code in some and status_code in others, so read it from the HTTP status line, not the body.
Standard error
Most 4xx errors. name is the HTTP reason phrase (Bad Request, Forbidden). description is usually a string, but can be an empty string or a list. Named errors use a different shape; see RequestDataError and other named errors.
{
"code": 403,
"name": "Forbidden",
"description": "Unapproved Users may not create routines."
}On POST /v1/routines/account-to-card, /card-to-account and /book, business-rule errors put a list in description, and one request can return several messages at once:
{
"code": 400,
"name": "Bad Request",
"description": [
"Destination card is not authorized for use.",
"Destination card is not enabled.",
"Destination card is not approved."
]
}Some errors add embedded_error. On card errors it holds a code you can branch on: card_authorization_declined, card_authorization_throttled or card_authorization_unavailable.
{
"code": 400,
"name": "Bad Request",
"description": "This card could not be authorized. Check the card details or use a different card.",
"embedded_error": { "code": "card_authorization_declined" }
}On POST /v1/accounts/processor_token, embedded_error passes Plaid's error through instead, with error_code and error_type rather than code:
{
"code": 400,
"name": "Bad Request",
"description": "Something went wrong while fetching Plaid Auth data with the supplied processor token.",
"embedded_error": {
"error_code": "INVALID_PROCESSOR_TOKEN",
"error_type": "INVALID_INPUT",
"error_message": "could not find matching processor token",
"display_message": null,
"request_id": "<plaid request id>",
"suggested_action": null
}
}RequestDataError and other named errors
RequestDataError and other named errorsField errors from schema validation. description maps each field to a list of messages, and nests for nested objects. _schema holds errors that aren't tied to one field, and on account-to-card and book also the amount format error.
{
"description": {
"destination": {
"user_id": ["Missing data for required field."]
}
},
"name": "RequestDataError",
"status_code": 400
}The same {description, name, status_code} shape, with a string description, is used for the named card errors on POST /v1/cards: IdempotencyKeyReused (422), and IdempotentRequestConflictDetected and CardChangedDuringAdd (409, with Retry-After: 1). For example:
{
"description": "Idempotency-Key was already used for a different card.",
"name": "IdempotencyKeyReused",
"status_code": 422
}Bare field map
Some endpoints return 422 with only the field map, no name or status: POST /v1/accounts/create, POST /v1/partner/identity/verification and PATCH /v1/users/USER_ID.
{
"routing_number": ["Routing number must be nine characters in length."]
}Internal server error
{
"description": "The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.",
"name": "Internal Server Error",
"status_code": 500
}Scheduled maintenance
During scheduled maintenance, POST /v1/cards, DELETE /v1/cards/{card_id}, POST /v1/routines, /account-to-card, /card-to-account and /book return 503 with only an error field, and Retry-After set to the seconds until the maintenance ends (at least 60, or 3600 when no end time is set):
{"error": "Service temporarily unavailable due to scheduled maintenance"}OAuth token endpoint
POST /v1/oauth/token returns the OAuth shape, {"error": "...", "error_description": "..."}. invalid_client comes with a WWW-Authenticate header and no error_description. Some of its other errors use the standard body, RequestDataError or 415. See Authentication.
Other shapes to expect
GET /v1/chargebacks/userputs the field name inside a string:"description": "user_id: Field required".GET /v1/payment_instruments/{id}for an unknown ID returns404with an empty object,{}.- A Bearer-auth
401caused by bad credentials has"description": "".
Response headers
| Header | Returned with | Meaning |
|---|---|---|
Request-Id | Every API response (not edge responses) | Unique ID for the request. Log it and include it in support tickets. |
Correlation-Id | Every API response | Echoes the Correlation-Id you send, or a generated value if you send none. Use it to tie requests to your own logs. |
Allow | 405 | The methods the path accepts. |
WWW-Authenticate | Some 401s, including the token endpoint's invalid_client | The authentication scheme expected. |
Retry-After | 429 from the usage limit; 503 for scheduled maintenance; 409 on POST /v1/cards | Seconds to wait: per the usage limit, until maintenance ends, or 1 for a card conflict. Not sent with the card authorization 429. |
HTTP status codes
| Status | Name | Most likely cause | What to do |
|---|---|---|---|
200 | OK | Request succeeded. DELETE /v1/cards/{id} returns 200 with {}, and DELETE /v1/accounts/{id} returns 200. | Continue. For transfers, keep listening for webhooks; the status can still change. |
201 | Created | Object created. | Store the returned id. |
204 | No Content | Only DELETE /v1/routines/{id}. | Nothing to read. |
400 | Bad Request | A field failed validation (RequestDataError), a business rule failed, the JSON was malformed, or the client ID was invalid on a Basic-auth endpoint. | Read description, fix the request. |
401 | Unauthorized | Missing or invalid credentials, or the wrong kind for the endpoint (Basic vs. Bearer). Also returned when a feature your client uses isn't enabled; the description then says it requires manual configuration by an Astra administrator. | See Authentication. For a feature that isn't enabled, contact Astra; a new token won't help. |
403 | Forbidden | Valid credentials, but the user or client isn't allowed this action, or a transfer or volume limit was exceeded. Also returned by the network edge, as HTML, when a secure-host endpoint is called on the general host. | See Permissions and configuration and Limits. |
404 | Not Found | Wrong path, unknown ID, or an object owned by another user or client. Both return the same response. | Check the ID and that you used the owning user's token. |
405 | Method Not Allowed | Wrong HTTP method. The Allow header lists the accepted ones. | Use a method from Allow. |
409 | Conflict | POST /v1/user_intent with an external_id that already belongs to a User (a duplicate email or phone doesn't return 409). POST /v1/cards while a request with the same key is still in progress, or when the card changed during the add. POST /v1/chargebacks/{chargeback_id}/submit for a chargeback in the wrong state. | For a User, look up the existing one. For a card, wait Retry-After (1 second) and retry with the same key and body. |
415 | Unsupported Media Type | The body isn't sent as application/json (or, on POST /v1/oauth/token, isn't a form). | Send Content-Type: application/json; send the token endpoint a URL-encoded form. |
422 | Unprocessable Content | Field errors returned as a bare field map, or an Idempotency-Key reused for a different card on POST /v1/cards (IdempotencyKeyReused). | Fix each listed field. For a card, use a new key for a new card. |
429 | Too Many Requests | More than 500 requests per minute to one host, or card authorization throttled on POST /v1/cards (embedded_error.code: card_authorization_throttled). See Usage Limits. | Wait Retry-After seconds, then back off. The card 429 has no Retry-After: back off. |
500 | Internal Server Error | An unexpected error, but also some invalid requests, and at least one request that succeeded. | See When to retry. Don't assume nothing happened. |
503 | Service Unavailable | Scheduled maintenance, card authorization temporarily unavailable (embedded_error.code: card_authorization_unavailable), Plaid data that couldn't be fetched for POST /v1/accounts/processor_token, or a chargeback endpoint that's unavailable. | Wait Retry-After seconds where it's sent, otherwise back off, then retry. |
The API reference doesn't document 406, 410, 502 or 504. A 502, 504 or other unexpected 5xx can come from the network edge. As Recommendations for a Robust Integration says, don't treat it as an outright failure: the outcome is unknown, so retry safely or look the object up before acting.
Error messages
The tables below list the description values you can expect, grouped by cause. Messages are for developers; their wording can change. Map the few you need to handle to your own user-facing text, and keep a fallback for anything else.
Authentication
Bearer endpoints (user access_token). A credentials failure returns the same body whether the header is missing, the token is invalid or expired, or Basic auth was sent instead:
{"code": 401, "name": "Unauthorized", "description": ""}A 401 with a non-empty description means something else: a feature isn't enabled for your client. See Permissions and configuration.
A malformed JSON body on POST /v1/routines returns 400 before the token is checked, even with no token.
Basic endpoints (client_id:client_secret). Credentials are checked before the body.
| Status | description | Cause and fix |
|---|---|---|
401 | Authorization header required. | No Authorization header. |
401 | Authorization header must be in the form `Basic abc123`. | A Bearer token or another scheme was sent. Use the client ID and secret. |
401 | Basic Authorization requires an encoded token in the form username:password | The decoded value has no : between client ID and secret. |
401 | The server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required. | A real client ID with the wrong secret. |
400 | Invalid client_id <client_id>. | The client ID doesn't exist in this environment. Note this is 400, not 401. |
OAuth token endpoint (POST /v1/oauth/token). Send a URL-encoded form with Basic auth.
| Status | Body | Cause and fix |
|---|---|---|
400 | {"error": "invalid_grant", "error_description": "Invalid refresh token. The token is either expired, revoked, or does not exist."} | Refresh grant with an unknown, expired or revoked refresh token. Send the user through the OAuth flow again. |
400 | {"error": "invalid_request", "error_description": "Missing \"refresh_token\" in request."} | Refresh grant without refresh_token. |
400 | {"error": "invalid_request", "error_description": "Invalid \"code\" in request."} | Authorization-code grant with an unknown or expired code. A code that was already used is expected to get the same response. Restart the OAuth flow; exchange each code once, promptly. |
400 | {"error": "invalid_request", "error_description": "Missing \"code\" in request."} | Authorization-code grant without code. |
401 | {"error": "invalid_client"}, with WWW-Authenticate on the refresh grant | A real client ID with the wrong secret (either grant), or an unknown client on the refresh grant. |
400 | {"code": 400, "name": "Bad Request", "description": "Invalid client_id <client_id>."} | Authorization-code grant with an unknown client. |
400 | RequestDataError, for example {"grant_type": ["Not a valid choice."]} | A form field is invalid. Form fields are checked before the client. |
415 | The server does not support the media type transmitted in the request. | The body was JSON, not a form. |
500 | Internal server error body | Refresh grant with no Authorization header. Always send Basic auth. |
Permissions and configuration
| Status | description | Where | Cause and fix |
|---|---|---|---|
401 | <Feature> functionality requires manual configuration by an Astra administrator. | Card auth details (GET /v1/cards/{id}/auth_details), debit, processor tokens, cross-border (GET /v1/foreign_exchange_rates) | The feature isn't enabled for your client. Contact Astra to enable it. Refreshing the token won't help. |
403 | Unapproved Users may not create routines. | POST /v1/routines | The user's status is pending, rejected or suspended. See User Statuses. |
403 | User is not permitted to use payment route. | POST /v1/routines/book | The token isn't the Business User's. |
403 | User is receive only. | account-to-card, card-to-account, book | The sending user can only receive funds. |
403 | Sender and Receiver are both unverified. | account-to-card, card-to-account, book | At least one side must be a verified user. |
403 | P2P transfer not allowed for this source and destination. | Routines | Your client isn't configured for transfers between these owners. Contact Astra, or use instruments owned by the same user. |
403 | Destination card is not authorized for use. | Card-to-card via POST /v1/routines | The card is blocked. On account-to-card the same message comes as a 400, in a list. |
403 | Client is not permitted to create account. | POST /v1/accounts/create (secure host) | Returned only when both checks fail: the request has no verification_method your client is enabled for, and the institution_id isn't your client's own (for example another client's ID, the other environment's ID, or a placeholder). See 403 Response When Creating a Bank Account. |
403 | This BIN is not authorized for use. | POST /v1/cards (secure host) | The card's BIN isn't accepted, for example a card that can't receive push payments. Ask for another debit card. |
403 | User has reached allowed debit card limit. | POST /v1/cards (secure host) | The user already has the maximum number of cards. Remove one first. |
403 | A user with this email and phone number combination was screened by Astra and was not permitted on the platform | POST /v1/user_intent | The email and phone pair was screened and rejected before. |
400 | Client is not enabled for requested preferred settlement speed. | POST /v1/routines | The requested preferred_settlement_speed is faster than your client's maximum. It isn't downgraded automatically. |
Limits
Limits are set per client, so the amounts in these messages vary.
| Status | description | Where | Cause |
|---|---|---|---|
403 | ["<amount> is over the transfer limit of <limit>."], for example ["$1,000,000.00 is over the transfer limit of $10,000.00."] | account-to-card | The amount is over the per-transfer limit. Returned alone: other errors, such as card errors, aren't listed. |
400 | The same message, at the end of the list after any card errors | card-to-account | The same limit, reported with the other business-rule errors. |
403 | <amount> is over the transfer limit of <limit>. | POST /v1/routines | The same limit. Other errors, such as an unknown source, are reported first. |
403 | Transfer amount would exceed the <interval> transfer volume limit for this <user, client or client user>. | Transfers and routines | A daily, weekly or monthly volume limit would be exceeded. Lower the amount or wait for the period to reset. |
Request validation
Field errors found by schema validation are reported together in one RequestDataError. Other checks run separately, so fixing one error can reveal the next:
- An empty body on account-to-card reports only
settlement_mode. - An invalid
Idempotency-Keyon account-to-card, card-to-account or book is reported ahead of business-rule errors, such as an unknown source, which aren't listed. - A missing
amountonPOST /v1/routinesis reported separately, asAn amount is required for one-time routines.
| Status | description | Where | Cause |
|---|---|---|---|
400 | {"<field>": ["Missing data for required field."]} | All JSON endpoints | A required field is missing. Nested objects nest the field map, for example destination.user_id. |
400 | {"<field>": ["Field may not be null."]} | All JSON endpoints | A required field is null. Some missing fields are reported this way too: POST /v1/routines reports a missing source_id with this message. |
400 | An amount is required for one-time routines. | POST /v1/routines | amount is missing or 0. |
400 | {"amount": ["Amount must be greater than or equal to 1 cent."]} | POST /v1/routines | Negative amount. |
400 | Amount must be a dollar amount in the format #.## | Routines | More than two decimal places. Under amount on POST /v1/routines, under _schema on account-to-card and book. |
400 | {"amount": ["Missing data for required field."]} | POST /v1/routines/book | amount is 0. |
400 | {"_schema": ["A routine cannot have 'amount' and 'percent_of_transaction' simultaneously."]} | POST /v1/routines | Send one or the other. |
400 | Invalid frequency: <value> is not a valid frequency for recurring routines. | POST /v1/routines | Unsupported frequency. |
400 | {"idempotency_key": ["Not a valid UUID."]} | account-to-card, card-to-account, book | These endpoints require a UUID key. |
400 | The browser (or proxy) sent a request that this server could not understand. | All JSON endpoints | Malformed JSON. |
400 | <param>: Field required / <param>: Extra inputs are not permitted | GET /v1/chargebacks/user | A required query parameter is missing, or an unknown one was sent. |
415 | The server does not support the media type transmitted in the request. or Did not attempt to load JSON data because the request Content-Type was not 'application/json'. | JSON endpoints (wording varies) | Send Content-Type: application/json. |
422 | Bare field map, for example {"routing_number": ["Routing number must be nine characters in length."]} | POST /v1/accounts/create | Fix each listed field. |
422 | {"_schema": ["At least one of `business_profile_id`, `user_id`, or `user_intent_id` must be provided."]} | POST /v1/partner/identity/verification | Send one of those IDs. Sending both business_profile_id and user_intent_id returns a similar _schema error. |
Unrecognized body fields are ignored on POST /v1/routines. Unknown query parameters are ignored on GET /v1/transfers, but rejected on GET /v1/chargebacks/user.
Listing and pagination
| Status | description | Cause |
|---|---|---|
400 | Could not locate cursor '<cursor_id>'. | The cursor_id doesn't exist. Restart from the first page. |
400 | {"page_size": ["Page size must be between 10 and 100."]} | page_size out of range. |
400 | {"status": ["'<value>' is an invalid status."]} | Unknown status filter. |
400 | {"sort_order": ["'<value>' is an invalid sort order. The only valid value is 'descending'."]} | sort_order other than descending. |
400 | Transfer queries using batch_id or batch_type must include values for both fields., under both batch_id and batch_type | GET /v1/transfers with only one of the two. |
500 | Internal server error body | GET /v1/transfers with a valid batch_id and a batch_type other than credit or debit. |
Resources and state
An object that belongs to another user or client returns the same response as one that doesn't exist.
| Status | description | Where |
|---|---|---|
404 | The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. | Any wrong path |
404 | Transfer not found. | GET /v1/transfers/{id} |
404 | AstraTransfer with ID <id> not found. | GET /v1/transfers/{id}/segments |
404 | Routine <id> not found. | GET /v1/routines/{id} |
404 | Card not found. | GET /v1/cards/{id} |
404 | Account <id> not found. | GET /v1/accounts/{id} |
404 | Account has been removed. | GET /v1/accounts/{id} for a deleted account |
404 | {} | GET /v1/payment_instruments/{id} |
400 | Could not find the specified source account. / Could not find the specified destination account. | POST /v1/routines with an unknown source or destination |
400 | ["Source account not found."] / ["Destination card not found."] | account-to-card with an unknown source or card |
400 | ["Source card not found."] | card-to-account with an unknown card, or another user's |
400 | ["Destination account not found."] | card-to-account with an unknown account, or with destination.user_id left out |
400 | ["User not found.", "Client not found.", "Source account not found.", "Destination account not found."] | book with an unknown source or destination. The list doesn't say which; check both. |
409 | A user with this external_id already exists for this client. | POST /v1/user_intent. Look up the existing User instead. |
409 | This chargeback cannot be submitted in its current state. | POST /v1/chargebacks/{chargeback_id}/submit |
400 | A bank account with this routing number and account number has already been created. | POST /v1/accounts/create. Reuse the existing account. |
400 | Specified AstraTransfer is not pending and cannot be cancelled. | POST /v1/transfers/{id}/cancel. See ACH Transfer Timing and Cancellation Windows. |
Some lookups don't fail: GET /v1/routines/{id}/transfers for an unknown routine returns 200 with an empty list. A deleted card is still returned by GET /v1/cards?include_removed=true, with "removed": true.
Cards and payments
| Status | name / description | Where | Cause and fix |
|---|---|---|---|
400 | This card could not be authorized. Check the card details or use a different card. with embedded_error.code: card_authorization_declined | POST /v1/cards | The issuer declined the verification, for example an expired card. Ask the user to check the details or use another card. |
400 | Card could not be added at this time, please try again later. | POST /v1/cards | Also returned when the user is rejected, so retrying won't help. Check the user's status. |
409 | name: IdempotentRequestConflictDetected | POST /v1/cards | A card add with the same Idempotency-Key is still in progress. Wait Retry-After (1 second) and retry with the same key and body. |
409 | name: CardChangedDuringAdd | POST /v1/cards | The card changed while it was being added. Wait Retry-After (1 second), then retry. |
422 | Idempotency-Key was already used for a different card. (name: IdempotencyKeyReused) | POST /v1/cards | Use a new key for a new card. |
429 | Card authorization is temporarily unavailable. Retry shortly. with embedded_error.code: card_authorization_throttled | POST /v1/cards | Card authorization is throttled. No Retry-After is sent: back off, then retry. |
503 | Card authorization is temporarily unavailable. Retry shortly. with embedded_error.code: card_authorization_unavailable | POST /v1/cards | Card authorization is down. Back off, then retry. |
400 | Something went wrong while fetching Plaid Auth data with the supplied processor token. with Plaid's error in embedded_error | POST /v1/accounts/processor_token | Plaid didn't recognize the processor token. Check embedded_error.error_code, for example INVALID_PROCESSOR_TOKEN, and create a new token. |
400 | List of Destination card is not authorized for use., Destination card is not enabled., Destination card is not approved. | account-to-card | The destination card is blocked, disabled or not approved. |
400 | List of Source card is not enabled., Source card is not approved., Source card is not authorized for use. | card-to-account | The same checks on the source card. |
400 | Destination card is pending approval. | POST /v1/routines | The destination card isn't approved. Also returned for a rejected card. Check Card Statuses and Review Reasons. |
Retries and idempotency
Resend money-movingPOSTrequests with the sameIdempotency-Keyand an identical bodyA reused key returns the original routine only when the body is the same. With a different body, Astra creates a new routine, and on account-to-card and book that means a second payout.
Which endpoints use Idempotency-Key
Idempotency-KeyOnly these endpoints document Idempotency-Key. See Guide to Idempotency Keys.
| Endpoint | Key format | Same key, same body | Same key, different body |
|---|---|---|---|
POST /v1/routines | UUID | 201 with the original routine (same id and created time). Nothing new is created. | A new routine is created. |
POST /v1/routines/account-to-card, /card-to-account, /book | UUID. Anything else returns 400 {"idempotency_key": ["Not a valid UUID."]}, checked before business rules. | 201 with the original routine. | A new routine is created, and on account-to-card and book a second payout is made. |
POST /v1/cards | 1–255 characters, kept for 24 hours | 201 with the original card, in its current state. While the first request is still in progress: 409 IdempotentRequestConflictDetected with Retry-After: 1. | 422 IdempotencyKeyReused. |
Without a key, adding a card the user already has returns 201 with the existing card (same id) and updates its name.
Don't rely on Idempotency-Key on any other endpoint, including POST /v1/accounts/create, POST /v1/user_intent and POST /v1/transfers/{id}/cancel. Treat a retry there as a new request, and look the object up before you retry.
Generate the key when the user takes the action (for example, taps Send), store it with your pending record together with the exact body, and reuse both for every retry of that operation. Use a UUID v4 everywhere so the same code works on all endpoints.
When to retry
| Outcome | Retry? | How |
|---|---|---|
No response: timeout, connection reset, or a 502, 504 or other 5xx from the network edge | Yes, safely | Don't treat it as a failure: the outcome is unknown. On an endpoint that uses Idempotency-Key, retry with the same key and identical body. Elsewhere, look the object up first and create it only if it's missing. |
500 | Yes, safely, but not in a loop | On an endpoint that uses Idempotency-Key, a retry with the same key and identical body is safe: it returns the original routine if the first request succeeded. Elsewhere, look the object up first. Some invalid requests return 500 every time; see below. |
429 | Yes | Wait Retry-After seconds, then back off. The card authorization 429 has no Retry-After: back off. |
503 | Yes | Wait Retry-After seconds when it's sent (scheduled maintenance), otherwise back off, then retry with the same key and body. |
409 on POST /v1/cards | Yes | Wait Retry-After (1 second), then retry with the same key and body. |
401 on a Bearer endpoint, empty description | Once | Refresh the user's token, then retry once. |
401 that says a feature requires manual configuration | No | Contact Astra to enable the feature. |
Any other 4xx | No | Fix the request or ask the user to act. The same request returns the same error. |
201, then the transfer failed | Not automatically | Read failure_reason. Retry only temporary failures, as a new transfer with a new key, and cap attempts. |
This matches Recommendations for a Robust Integration, which says not to treat a 502, 504 or other 5xx as an outright failure, and that a retry with the same payload and the same Idempotency-Key is safe.
What a 500 can mean
500 can mean- The write happened.
POST /v1/accounts/createhas returned500in sandbox after creating the account. It doesn't useIdempotency-Key, so a retry returns400A bank account with this routing number and account number has already been created.List the user's accounts before retrying. - The request is invalid and will fail every time. For example: a non-numeric
amounton/bookor/account-to-card, a missingamountor empty body on/book, an empty body onPOST /v1/cards, or an invalidbatch_typewith a validbatch_idonGET /v1/transfers. If a retry returns500again, check the request against the API reference instead of retrying further. - An unexpected error. Retry as described above. If it keeps failing, contact support with the
Request-Id.
Cancellations aren't always final
A 200 from POST /v1/transfers/{id}/cancel doesn't guarantee the transfer stops: a transfer can still move to processed shortly after. Read the transfer again, and rely on Transfer Webhooks for its final status.
Backoff
Usage Limits recommends exponential backoff with jitter. One reasonable setup: wait a random time between 0 and min(cap, base × 2^attempt), with base = 1 second and cap = 30 seconds, for at most 5 attempts. When Retry-After is present, wait at least that long. Spread scheduled batch jobs evenly across each minute rather than bursting.
OCT and card network failures
Card, real-time and bank failures are not HTTP errors: the create request returns 201, and the Transfer later moves to status: failed with a reason in failure_reason. Handle them from Transfer Webhooks and Get a Specific Transfer.
How an account-to-card (OCT) payout fails
When the OCT fails, the transfer and its parent Routine both become failed, and Astra doesn't process money movement against the source account. How the source debit works depends on settlement_mode.
Gross debit
- Astra creates a per-transfer Same Day ACH debit from the source account and sends the OCT to the destination card at the same time.
- If the OCT is declined, the transfer and the Routine fail, and Astra cancels the Same Day ACH debit.
- If the OCT succeeds, the transfer is
processed. If the ACH debit is returned days later, the transfer moves fromprocessedtofailed; the Routine's status doesn't change.
Net debit
- Astra sends the OCT first.
- If the OCT is declined, the transfer and the Routine fail, and the transfer is left out of the next ACH batch.
- If the OCT succeeds, the amount is included in the next business day's ACH batch debit.
Each leg is a segment with its own status, failure_reason and trace number. Use Get Details on the Segments of a Transfer to see which leg failed. Full behavior: Account-to-Card Statuses (Instant Disbursements).
Reading failure_reason
failure_reason| Format | Example | Meaning |
|---|---|---|
<code> - <description> (card) | 05 - Do not honor | The 2-character ISO 8583 response code from the issuer or card network, and the network's description. |
<code> - <reason>, or <code> alone (ACH return) | R01 - Insufficient Funds, R01 | An ACH leg was returned. The code is the ACH return code; the receiving bank's reason follows when it sends one. |
<code> - ACH transfer rejected, or ACH transfer rejected alone | R03 - ACH transfer rejected | An ACH leg was rejected. |
Debit processing error. | Debit processing error. | A generic processing error, usually an intermittent network issue. |
| Free text | Destination bank does not support RTP instant transfers | A real-time payout couldn't be delivered. Seen on the Transfer, with the segment's own failure_reason left null. |
When the string contains -, the code is the part before it. Otherwise, check whether the whole string is a code (such as R01) or a message. Always keep a fallback branch: new reasons appear, so an unrecognized one must not break your flow. The same value appears as Failure Reason on the transfer page in the Astra Dashboard.
Issuers don't tell Astra why they chose a code, and banks use codes differently. Astra can't give the specific reason for a decline; the cardholder must ask their bank.
Real-time payouts
A real-time payout to an account that can't receive real-time payments falls back to Same Day ACH by default: the instant segment fails, Astra adds an ach segment, and the transfer stays pending. The fallback only starts if the RTP or FedNow attempt fails within 60 minutes of the transfer's creation. If it fails later, the transfer becomes failed and is unwound. With disable_alternative_routing: true, nothing else is tried: the transfer and the Routine become failed with the free-text reason above. See Real-Time & ACH Same Day Transfers.
Common decline codes and what to do
Code names follow Astra's Debit Network Decline Codes, which lists 101 codes. Where that article gives an action, it's used below; the other actions are general guidance.
| Code | Name | Suggested action | Retry? |
|---|---|---|---|
05 | Do not honor | Ask the user to call their bank or use another card. | No |
14 | Invalid card number | Ask the user to re-enter or relink the card. | No |
41 | Lost Card | Block the card; don't retry. | No |
43 | Stolen Card | Block the card; don't retry. | No |
51 | Insufficient funds | Relevant to pulls; ask the user to fund the account or use another card. | No |
54 | Expired Card | Ask the user to update the card. | No |
57 | Transaction not permitted to cardholder | Ask for another card. Common on prepaid or restricted cards. | No |
59 | Suspected Fraud | Don't retry; review the user. | No |
61 | Exceeds Withdrawal Limit | Ask the user to use another card, or to speak with their bank. | No |
65 | Exceeds Withdrawal | Ask the user to use another card, or to speak with their bank. | No |
62 | Restricted card | Ask for another card. | No |
78 | Customer not eligible for POS | Often a newly activated or frozen card; ask the user to activate or unfreeze it, then retry manually. | No |
91 | Issuer unavailable | Retry later. | Once, after a few minutes |
96 | System error | Retry a few minutes later; if it persists, the user should contact their bank. | Once, after a few minutes |
5C | Blocked by issuer | Ask the user to contact their bank. | No |
9G | Blocked by cardholder | Ask the user to remove the block in their banking app. | No |
R0 | Recurring charge stopped at customer request / Fraudulent transaction prior to embossed valid date (future) | Stop the routine; get new authorization. | No |
R1 | Recurring charge stopped at customer request | Stop the routine; get new authorization. | No |
A retry of a failed transfer is always a new transfer with a new Idempotency-Key. Retry only temporary failures (91, 96, Debit processing error.), and at most once.
ACH returns
ACH legs can fail days after a transfer shows processed, when the receiving bank sends a return code such as R01 (insufficient funds) or R10 (unauthorized). The Transfer moves to failed. An R08 or R10 return also moves the User to suspended automatically, which arrives on User Webhooks. Depending on which leg was returned, your program can end with a net zero, negative or positive balance. See Guide to Managing ACH Returns.
Astra Knowledge Base articles
| Article | Use it for |
|---|---|
| Debit Network Decline Codes | Every card decline code and its meaning. |
| Account-to-Card Statuses (Instant Disbursements) | How OCT failures affect the Transfer, Routine and source debit. |
| Instant Disbursements | Gross Debit Mode | Per-transfer Same Day ACH debit and its cancellation on OCT failure. |
| Instant Disbursements | Net Debit Mode | Batched next-day ACH debit behavior. |
| Real-Time & ACH Same Day Transfers | Real-time payouts and the ACH fallback window. |
| Guide to Managing ACH Returns | ACH return codes, tracking and balance impact. |
| ACH Return Codes | A Guide from Astra | The full R-code list. |
| ACH Transfer Timing and Cancellation Windows | When a transfer can still be cancelled. |
| A Guide to Routine & Transfer Statuses & Webhooks | Which webhook fires on each status change. |
| Guide to Idempotency Keys | Key formats and replay behavior for routines and cards. |
| Chargeback Dispute Timeline | Card-to-account disputes after settlement. |
Go-live checklist
- Branch on the HTTP status first. Branch on
nameonly for named errors such asRequestDataErrororIdempotencyKeyReused(for standard errors it's just the HTTP reason phrase), and onembedded_error.codewhere it's present. - Map known
descriptionvalues only where you need to, and keep a fallback for everything else. Handledescriptionas a string, a list, a field map or an empty string. - Check
Content-Typebefore parsing, and handle HTML, maintenance ({"error": ...}) and unparseable bodies. - Call
POST /v1/cardsandPOST /v1/accounts/createon the secure host. - Log
Request-Idfor every failed call, and send your ownCorrelation-Idto tie requests to your logs. - Send a UUID v4
Idempotency-Keyon routine creation and card adds, and store it with the exact body so a retry resends both unchanged. - On a timeout,
5xxor edge error, retry with the same key and body where the endpoint usesIdempotency-Key; elsewhere, look the object up first. Don't loop on a500that repeats. - Honor
Retry-Afteron429,503and the card409, and back off where it isn't sent. - Treat a
401that says a feature requires manual configuration as a setup issue for Astra, not an expired token. - Subscribe to Transfer, Routine and User webhooks. Treat
processedas non-final for ACH legs, and a successful cancel as non-final until the transfer readscancelled. - Parse
failure_reason, map the reasons you handle to user messages, and keep a fallback for unknown ones. - Show users a plain message ("Your bank declined this card. Try another debit card."), not raw network or API text.
- Test the error paths in sandbox before submitting your Sandbox Deliverable Review.
Still stuck? Open a ticket in the Astra Support Portal with the Request-Id, the endpoint, the timestamp and the environment.