Errors

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 upWhenWhat to read
HTTP 4xx responseImmediately; the request was rejectedHTTP status, name, description, embedded_error.code
HTTP 5xx responseImmediately; the outcome may be unknownHTTP status, Request-Id header
Transfer status: failedSeconds (OCT, real-time) to days (ACH return) after a 201failure_reason on the Transfer

Hosts

EnvironmentGeneral hostSecure host
Productionhttps://api.astra.financehttps://secure.api.astra.finance
Sandboxhttps://api-sandbox.astra.financehttps://secure.api-sandbox.astra.finance
🚧

Use the secure host for cards and account creation

Call POST /v1/cards and POST /v1/accounts/create on the secure host. Sent to the general host, they are blocked at the network edge with an HTML 403 page that has no Request-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

Field 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/user puts the field name inside a string: "description": "user_id: Field required".
  • GET /v1/payment_instruments/{id} for an unknown ID returns 404 with an empty object, {}.
  • A Bearer-auth 401 caused by bad credentials has "description": "".

Response headers

HeaderReturned withMeaning
Request-IdEvery API response (not edge responses)Unique ID for the request. Log it and include it in support tickets.
Correlation-IdEvery API responseEchoes the Correlation-Id you send, or a generated value if you send none. Use it to tie requests to your own logs.
Allow405The methods the path accepts.
WWW-AuthenticateSome 401s, including the token endpoint's invalid_clientThe authentication scheme expected.
Retry-After429 from the usage limit; 503 for scheduled maintenance; 409 on POST /v1/cardsSeconds 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

StatusNameMost likely causeWhat to do
200OKRequest 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.
201CreatedObject created.Store the returned id.
204No ContentOnly DELETE /v1/routines/{id}.Nothing to read.
400Bad RequestA 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.
401UnauthorizedMissing 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.
403ForbiddenValid 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.
404Not FoundWrong 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.
405Method Not AllowedWrong HTTP method. The Allow header lists the accepted ones.Use a method from Allow.
409ConflictPOST /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.
415Unsupported Media TypeThe 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.
422Unprocessable ContentField 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.
429Too Many RequestsMore 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.
500Internal Server ErrorAn unexpected error, but also some invalid requests, and at least one request that succeeded.See When to retry. Don't assume nothing happened.
503Service UnavailableScheduled 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.

StatusdescriptionCause and fix
401Authorization header required.No Authorization header.
401Authorization header must be in the form `Basic abc123`.A Bearer token or another scheme was sent. Use the client ID and secret.
401Basic Authorization requires an encoded token in the form username:passwordThe decoded value has no : between client ID and secret.
401The 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.
400Invalid 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.

StatusBodyCause 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 grantA 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.
400RequestDataError, for example {"grant_type": ["Not a valid choice."]}A form field is invalid. Form fields are checked before the client.
415The server does not support the media type transmitted in the request.The body was JSON, not a form.
500Internal server error bodyRefresh grant with no Authorization header. Always send Basic auth.

Permissions and configuration

StatusdescriptionWhereCause 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.
403Unapproved Users may not create routines.POST /v1/routinesThe user's status is pending, rejected or suspended. See User Statuses.
403User is not permitted to use payment route.POST /v1/routines/bookThe token isn't the Business User's.
403User is receive only.account-to-card, card-to-account, bookThe sending user can only receive funds.
403Sender and Receiver are both unverified.account-to-card, card-to-account, bookAt least one side must be a verified user.
403P2P transfer not allowed for this source and destination.RoutinesYour client isn't configured for transfers between these owners. Contact Astra, or use instruments owned by the same user.
403Destination card is not authorized for use.Card-to-card via POST /v1/routinesThe card is blocked. On account-to-card the same message comes as a 400, in a list.
403Client 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.
403This 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.
403User has reached allowed debit card limit.POST /v1/cards (secure host)The user already has the maximum number of cards. Remove one first.
403A user with this email and phone number combination was screened by Astra and was not permitted on the platformPOST /v1/user_intentThe email and phone pair was screened and rejected before.
400Client is not enabled for requested preferred settlement speed.POST /v1/routinesThe 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.

StatusdescriptionWhereCause
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-cardThe amount is over the per-transfer limit. Returned alone: other errors, such as card errors, aren't listed.
400The same message, at the end of the list after any card errorscard-to-accountThe same limit, reported with the other business-rule errors.
403<amount> is over the transfer limit of <limit>.POST /v1/routinesThe same limit. Other errors, such as an unknown source, are reported first.
403Transfer amount would exceed the <interval> transfer volume limit for this <user, client or client user>.Transfers and routinesA 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-Key on 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 amount on POST /v1/routines is reported separately, as An amount is required for one-time routines.
StatusdescriptionWhereCause
400{"<field>": ["Missing data for required field."]}All JSON endpointsA required field is missing. Nested objects nest the field map, for example destination.user_id.
400{"<field>": ["Field may not be null."]}All JSON endpointsA required field is null. Some missing fields are reported this way too: POST /v1/routines reports a missing source_id with this message.
400An amount is required for one-time routines.POST /v1/routinesamount is missing or 0.
400{"amount": ["Amount must be greater than or equal to 1 cent."]}POST /v1/routinesNegative amount.
400Amount must be a dollar amount in the format #.##RoutinesMore 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/bookamount is 0.
400{"_schema": ["A routine cannot have 'amount' and 'percent_of_transaction' simultaneously."]}POST /v1/routinesSend one or the other.
400Invalid frequency: <value> is not a valid frequency for recurring routines.POST /v1/routinesUnsupported frequency.
400{"idempotency_key": ["Not a valid UUID."]}account-to-card, card-to-account, bookThese endpoints require a UUID key.
400The browser (or proxy) sent a request that this server could not understand.All JSON endpointsMalformed JSON.
400<param>: Field required / <param>: Extra inputs are not permittedGET /v1/chargebacks/userA required query parameter is missing, or an unknown one was sent.
415The 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.
422Bare field map, for example {"routing_number": ["Routing number must be nine characters in length."]}POST /v1/accounts/createFix 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/verificationSend 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

StatusdescriptionCause
400Could 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.
400Transfer queries using batch_id or batch_type must include values for both fields., under both batch_id and batch_typeGET /v1/transfers with only one of the two.
500Internal server error bodyGET /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.

StatusdescriptionWhere
404The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.Any wrong path
404Transfer not found.GET /v1/transfers/{id}
404AstraTransfer with ID <id> not found.GET /v1/transfers/{id}/segments
404Routine <id> not found.GET /v1/routines/{id}
404Card not found.GET /v1/cards/{id}
404Account <id> not found.GET /v1/accounts/{id}
404Account has been removed.GET /v1/accounts/{id} for a deleted account
404{}GET /v1/payment_instruments/{id}
400Could 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.
409A user with this external_id already exists for this client.POST /v1/user_intent. Look up the existing User instead.
409This chargeback cannot be submitted in its current state.POST /v1/chargebacks/{chargeback_id}/submit
400A bank account with this routing number and account number has already been created.POST /v1/accounts/create. Reuse the existing account.
400Specified 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

Statusname / descriptionWhereCause and fix
400This card could not be authorized. Check the card details or use a different card. with embedded_error.code: card_authorization_declinedPOST /v1/cardsThe issuer declined the verification, for example an expired card. Ask the user to check the details or use another card.
400Card could not be added at this time, please try again later.POST /v1/cardsAlso returned when the user is rejected, so retrying won't help. Check the user's status.
409name: IdempotentRequestConflictDetectedPOST /v1/cardsA card add with the same Idempotency-Key is still in progress. Wait Retry-After (1 second) and retry with the same key and body.
409name: CardChangedDuringAddPOST /v1/cardsThe card changed while it was being added. Wait Retry-After (1 second), then retry.
422Idempotency-Key was already used for a different card. (name: IdempotencyKeyReused)POST /v1/cardsUse a new key for a new card.
429Card authorization is temporarily unavailable. Retry shortly. with embedded_error.code: card_authorization_throttledPOST /v1/cardsCard authorization is throttled. No Retry-After is sent: back off, then retry.
503Card authorization is temporarily unavailable. Retry shortly. with embedded_error.code: card_authorization_unavailablePOST /v1/cardsCard authorization is down. Back off, then retry.
400Something went wrong while fetching Plaid Auth data with the supplied processor token. with Plaid's error in embedded_errorPOST /v1/accounts/processor_tokenPlaid didn't recognize the processor token. Check embedded_error.error_code, for example INVALID_PROCESSOR_TOKEN, and create a new token.
400List of Destination card is not authorized for use., Destination card is not enabled., Destination card is not approved.account-to-cardThe destination card is blocked, disabled or not approved.
400List of Source card is not enabled., Source card is not approved., Source card is not authorized for use.card-to-accountThe same checks on the source card.
400Destination card is pending approval.POST /v1/routinesThe destination card isn't approved. Also returned for a rejected card. Check Card Statuses and Review Reasons.

Retries and idempotency

🚧

Resend money-moving POST requests with the same Idempotency-Key and an identical body

A 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

Only these endpoints document Idempotency-Key. See Guide to Idempotency Keys.

EndpointKey formatSame key, same bodySame key, different body
POST /v1/routinesUUID201 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, /bookUUID. 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/cards1–255 characters, kept for 24 hours201 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

OutcomeRetry?How
No response: timeout, connection reset, or a 502, 504 or other 5xx from the network edgeYes, safelyDon'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.
500Yes, safely, but not in a loopOn 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.
429YesWait Retry-After seconds, then back off. The card authorization 429 has no Retry-After: back off.
503YesWait Retry-After seconds when it's sent (scheduled maintenance), otherwise back off, then retry with the same key and body.
409 on POST /v1/cardsYesWait Retry-After (1 second), then retry with the same key and body.
401 on a Bearer endpoint, empty descriptionOnceRefresh the user's token, then retry once.
401 that says a feature requires manual configurationNoContact Astra to enable the feature.
Any other 4xxNoFix the request or ask the user to act. The same request returns the same error.
201, then the transfer failedNot automaticallyRead 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

  • The write happened. POST /v1/accounts/create has returned 500 in sandbox after creating the account. It doesn't use Idempotency-Key, so a retry returns 400 A 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 amount on /book or /account-to-card, a missing amount or empty body on /book, an empty body on POST /v1/cards, or an invalid batch_type with a valid batch_id on GET /v1/transfers. If a retry returns 500 again, 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

  1. 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.
  2. If the OCT is declined, the transfer and the Routine fail, and Astra cancels the Same Day ACH debit.
  3. If the OCT succeeds, the transfer is processed. If the ACH debit is returned days later, the transfer moves from processed to failed; the Routine's status doesn't change.

Net debit

  1. Astra sends the OCT first.
  2. If the OCT is declined, the transfer and the Routine fail, and the transfer is left out of the next ACH batch.
  3. 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

FormatExampleMeaning
<code> - <description> (card)05 - Do not honorThe 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, R01An 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 aloneR03 - ACH transfer rejectedAn ACH leg was rejected.
Debit processing error.Debit processing error.A generic processing error, usually an intermittent network issue.
Free textDestination bank does not support RTP instant transfersA 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.

CodeNameSuggested actionRetry?
05Do not honorAsk the user to call their bank or use another card.No
14Invalid card numberAsk the user to re-enter or relink the card.No
41Lost CardBlock the card; don't retry.No
43Stolen CardBlock the card; don't retry.No
51Insufficient fundsRelevant to pulls; ask the user to fund the account or use another card.No
54Expired CardAsk the user to update the card.No
57Transaction not permitted to cardholderAsk for another card. Common on prepaid or restricted cards.No
59Suspected FraudDon't retry; review the user.No
61Exceeds Withdrawal LimitAsk the user to use another card, or to speak with their bank.No
65Exceeds WithdrawalAsk the user to use another card, or to speak with their bank.No
62Restricted cardAsk for another card.No
78Customer not eligible for POSOften a newly activated or frozen card; ask the user to activate or unfreeze it, then retry manually.No
91Issuer unavailableRetry later.Once, after a few minutes
96System errorRetry a few minutes later; if it persists, the user should contact their bank.Once, after a few minutes
5CBlocked by issuerAsk the user to contact their bank.No
9GBlocked by cardholderAsk the user to remove the block in their banking app.No
R0Recurring charge stopped at customer request / Fraudulent transaction prior to embossed valid date (future)Stop the routine; get new authorization.No
R1Recurring charge stopped at customer requestStop 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

ArticleUse it for
Debit Network Decline CodesEvery 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 ModePer-transfer Same Day ACH debit and its cancellation on OCT failure.
Instant Disbursements | Net Debit ModeBatched next-day ACH debit behavior.
Real-Time & ACH Same Day TransfersReal-time payouts and the ACH fallback window.
Guide to Managing ACH ReturnsACH return codes, tracking and balance impact.
ACH Return Codes | A Guide from AstraThe full R-code list.
ACH Transfer Timing and Cancellation WindowsWhen a transfer can still be cancelled.
A Guide to Routine & Transfer Statuses & WebhooksWhich webhook fires on each status change.
Guide to Idempotency KeysKey formats and replay behavior for routines and cards.
Chargeback Dispute TimelineCard-to-account disputes after settlement.

Go-live checklist

  • Branch on the HTTP status first. Branch on name only for named errors such as RequestDataError or IdempotencyKeyReused (for standard errors it's just the HTTP reason phrase), and on embedded_error.code where it's present.
  • Map known description values only where you need to, and keep a fallback for everything else. Handle description as a string, a list, a field map or an empty string.
  • Check Content-Type before parsing, and handle HTML, maintenance ({"error": ...}) and unparseable bodies.
  • Call POST /v1/cards and POST /v1/accounts/create on the secure host.
  • Log Request-Id for every failed call, and send your own Correlation-Id to tie requests to your logs.
  • Send a UUID v4 Idempotency-Key on routine creation and card adds, and store it with the exact body so a retry resends both unchanged.
  • On a timeout, 5xx or edge error, retry with the same key and body where the endpoint uses Idempotency-Key; elsewhere, look the object up first. Don't loop on a 500 that repeats.
  • Honor Retry-After on 429, 503 and the card 409, and back off where it isn't sent.
  • Treat a 401 that says a feature requires manual configuration as a setup issue for Astra, not an expired token.
  • Subscribe to Transfer, Routine and User webhooks. Treat processed as non-final for ACH legs, and a successful cancel as non-final until the transfer reads cancelled.
  • 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.