Skip to main content

Ticket Failure Codes

When a ticket ends FAILED or PARTIAL-FAILED, its failureCode field says why, as a stable, machine-readable code. Branch your integration on failureCode, not on the text of failureReason.

failureCode sits next to failureReason everywhere a ticket is returned:

It is "" while the ticket has not failed.

failureCode and failureReason​

FieldWhat it is for
failureCodeThe reason as a fixed code. Use it in your code: to decide what to show your user, whether to retry, and what to fix.
failureReasonA human-readable explanation for logs and support. Its wording can change, so don't parse it or compare it with fixed strings.
reasonHuman-readable progress notes, such as Refund in progress. followed by the refund end-to-end ID. Don't parse it either.

The texts failureReason and reason carry today are unchanged, so an integration that already matches on them keeps working while you move to failureCode.

Stability​

  • Codes are only ever added. An existing code is never renamed or removed, and its meaning doesn't change.
  • New codes can appear without notice. Treat a code you don't recognise as a generic failure: use status to know where the funds are, show a generic message, and log failureReason.

Reading status and failureCode together​

status tells you where the money is; failureCode tells you why. Some codes can come with either status, depending on whether the ticket failed while receiving the input or while delivering the output, so always read both.

statusWhat happenedThe funds
FAILEDThe ticket failed while receiving the input.A PIX deposit is returned to the sender. A blockchain or Avenia-balance (INTERNAL) input was not collected.
PARTIAL-FAILEDThe input was received, then the delivery failed.Credited to your Avenia balance, in the currency the operation had reached. Not sent back on-chain.

The exception is INTERNAL_ERROR on a FAILED ticket during delivery: contact support with the ticket id. The full picture of where the funds are after each kind of failure is in Ticket Lifecycle and Failures.

Example​

A PIX payout to a beneficiary whose bank is blocked for your account (other ticket fields omitted):

{
"ticket": {
"id": "c4bd34dd-cbb2-4cda-b158-f104dd67d0c8",
"status": "PARTIAL-FAILED",
"reason": "",
"failureReason": "ticket failed partially: receiver bank institution is blocked - tokens returned to user's wallet",
"failureCode": "RECEIVER_BLOCKED_BANK_INSTITUTION"
}
}

Codes​

The Retry? column is a hint for the cases where the answer is clear. A retry always means a new quote and a new ticket.

Pay-in checks​

The deposit was refused before it was credited. The ticket ends FAILED and the deposit is returned to the sender.

CodeMeaningStatusWhere the funds areRetry?
SENDER_BLOCKED_BANK_INSTITUTIONThe sender's bank institution is blocked.FAILEDReturned to the sender.Not from this institution.
SENDER_BLOCKED_TAX_IDThe sender's tax ID is blocked.FAILEDReturned to the sender.Not from this sender.
SENDER_BLOCKEDThe sender is blocked.FAILEDReturned to the sender.Not from this sender.
THIRD_PARTY_DEPOSITDeposits from third parties are not allowed for this user.FAILEDReturned to the sender.Pay from the account holder's own bank account.
DEPOSIT_RETURNEDThe deposit failed at the payment network and is being returned to the sender.FAILEDReturned to the sender.

Avenia rules​

Limits, compliance and account rules. At pay-in the ticket ends FAILED and the deposit is returned to the sender (an INTERNAL input is not debited). At delivery it ends PARTIAL-FAILED and the amount is credited to your Avenia balance.

CodeMeaningStatusWhere the funds areRetry?
COMPLIANCE_REJECTEDRejected for compliance reasons. Permanent for this counterparty.FAILED or PARTIAL-FAILEDReturned to the sender, or in your balance.Never, for this counterparty.
COMPLIANCE_TEMPORARY_HOLDTemporarily held for compliance review.FAILED or PARTIAL-FAILEDReturned to the sender, or in your balance.After the hold expires — see below.
COMPLIANCE_UNDER_REVIEWThe counterparty is under compliance review until compliance decides.FAILED or PARTIAL-FAILEDReturned to the sender, or in your balance.Not until the review ends.
LIMIT_EXCEEDEDThe user's available limit is not enough for this operation.FAILED or PARTIAL-FAILEDReturned to the sender, or in your balance.Once the limit allows, or with a smaller amount.
LIMIT_NOT_CONFIGUREDThe user has no limit configured for this operation.FAILED or PARTIAL-FAILEDReturned to the sender, or in your balance.
USER_BLOCKEDThe user is blocked.FAILED or PARTIAL-FAILEDReturned to the sender, or in your balance.No. Contact compliance@avenia.io.
RECEIVER_BLOCKED_TAX_IDThe receiver's tax ID is blocked.PARTIAL-FAILEDIn your balance.Not to this receiver.
RECEIVER_BLOCKED_BANK_INSTITUTIONThe receiver's bank institution is blocked.PARTIAL-FAILEDIn your balance.Not to this institution.
RECEIVER_BLOCKED_WALLET_ADDRESSThe receiver's wallet address is blocked.PARTIAL-FAILEDIn your balance.Not to this address.
RECEIVER_BLOCKEDThe receiver is blocked.PARTIAL-FAILEDIn your balance.Not to this receiver.
THIRD_PARTY_PAYOUTPayouts to third parties are not allowed for this user.PARTIAL-FAILEDIn your balance.Only to the account holder.

For COMPLIANCE_TEMPORARY_HOLD, COMPLIANCE_UNDER_REVIEW and COMPLIANCE_REJECTED, the KYT state endpoint and the KYT-STATE webhook tell you the current compliance state and, for a temporary hold, when it expires.

Fee Account​

Only for accounts with the Fee Account enabled, on tickets quoted with feeSettlement=FEE_ACCOUNT. Other accounts never receive it.

CodeMeaningStatusWhere the funds areRetry?
FEE_ACCOUNT_INSUFFICIENT_BALANCEYour Fee Account does not have enough balance for the ticket's fees.FAILED or PARTIAL-FAILEDReturned to the sender (an INTERNAL input is not debited), or in your balance.After topping up the Fee Account.

Receiver's bank​

The receiving institution refused or couldn't complete the payout. The ticket ends PARTIAL-FAILED and the amount is credited to your Avenia balance.

CodeMeaningStatusWhere the funds areRetry?
RECEIVER_BANK_REJECTEDThe receiver's bank rejected the payment.PARTIAL-FAILEDIn your balance.Confirm the account with the beneficiary first.
RECEIVER_BANK_TIMEOUTThe receiver's bank timed out.PARTIAL-FAILEDIn your balance.Yes, it may succeed later.
RECEIVER_BANK_UNAVAILABLEThe receiver's bank answered with an error or an invalid response.PARTIAL-FAILEDIn your balance.Yes, it may succeed later.
RECEIVER_BR_CODE_NOT_PAYABLEThe QR code can no longer be paid: it expired, was already paid or was refused by the receiver.PARTIAL-FAILEDIn your balance.Not with the same QR code.
RECEIVER_BR_CODE_INVALIDThe QR code is invalid.PARTIAL-FAILEDIn your balance.After fixing the QR code.
RECEIVER_PIX_KEY_INVALIDThe PIX key is invalid or does not exist.PARTIAL-FAILEDIn your balance.After fixing the PIX key.
RECEIVER_ACCOUNT_INVALIDThe receiver's account details are invalid.PARTIAL-FAILEDIn your balance.After fixing the account details.
RECEIVER_ACCOUNT_BLOCKED_BY_BANKThe receiver's account is blocked or restricted by its bank.PARTIAL-FAILEDIn your balance.Not to this account.
RECEIVER_ACCOUNT_CLOSEDThe receiver's account is closed.PARTIAL-FAILEDIn your balance.Not to this account.
RECEIVER_ACCOUNT_LIMIT_EXCEEDEDThe amount is above what the receiver's account accepts.PARTIAL-FAILEDIn your balance.With a smaller amount.

Blockchain or Avenia-balance input​

The input couldn't be collected. The ticket ends FAILED and nothing was debited.

CodeMeaningStatusWhere the funds areRetry?
INSUFFICIENT_BALANCEThe sending wallet or balance does not have enough funds.FAILEDNot collected.After topping up.
INSUFFICIENT_ALLOWANCEThe sending wallet did not approve enough allowance.FAILEDNot collected.After raising the allowance.
INVALID_SIGNATUREThe permit or signature is invalid.FAILEDNot collected.After signing again.
WALLET_NOT_AUTHORIZEDThe sending wallet is not authorized for this operation.FAILEDNot collected.
SLIPPAGE_EXCEEDEDThe price moved beyond the accepted slippage.FAILEDNot collected.Yes.
TRANSACTION_DEADLINE_EXPIREDThe transaction deadline expired before it executed.FAILEDNot collected.Yes.

Payout, refund and general​

CodeMeaningStatusWhere the funds areRetry?
PAYOUT_FAILEDThe payout failed at the payment network.PARTIAL-FAILEDIn your balance.
PAYOUT_RETURNEDThe payout was sent and then returned.PARTIAL-FAILEDIn your balance.
PAYOUT_UNAVAILABLEThis payout route is temporarily unavailable.PARTIAL-FAILEDIn your balance.Yes, later.
UNSUPPORTED_ROUTEThis payout route is not supported for this ticket.PARTIAL-FAILEDIn your balance.Not on this route. See Available Combinations.
REFUND_WINDOW_EXPIREDThe original payment can no longer be refunded.PARTIAL-FAILEDIn your balance.No.
ALREADY_REFUNDEDThe original payment was already refunded.PARTIAL-FAILEDIn your balance.No.
REFUND_AMOUNT_EXCEEDS_ORIGINALThe refund amount exceeds the original payment.PARTIAL-FAILEDIn your balance.
REFUND_FAILEDThe refund failed.PARTIAL-FAILEDIn your balance.
INTERNAL_ERRORAn internal error on Avenia's side.Any — read statusDepends on status. On a FAILED ticket during delivery the input may already have been debited.It may succeed later. If funds look stuck, contact support with the ticket id.