Skip to main content

Overview

When a payment attempt fails, Dodo Payments returns a standardized failure code that tells you why. The codes are the same across payment methods and payment processors, so one set of handling rules covers every failed payment. The payment.failed webhook and the payment object expose these fields for a failed payment:
  • error_code: a standardized failure code from the table below.
  • error_message: an explanation written for you, the merchant. When error_code is one of the standardized codes below, this is a headline plus the recommended action, not the raw text from the payment processor.
  • retry_attempt: 0 for the original charge, and 1 or higher for each scheduled subscription renewal retry. Payments that are not subscription renewals keep the value 0.
Use these codes to give customers clear feedback, decide whether a retry can succeed, and recover more revenue.

Merchant Copy vs. Customer Copy

Each standardized failure code maps to two messages, one for you and one for your customer:
The Customer Portal returns the customer wording in error_message, while the merchant API returns the merchant wording for the same payment. The error_code is the same in both.

Handle Payment Failures

A step-by-step developer guide for reading these codes from webhooks and the API, showing them to customers, and deciding when to retry.

Soft vs. Hard Declines

Each failure code is either a soft decline or a hard decline. The type tells you whether a later attempt with the same payment details can succeed, or whether the customer must act first. For subscription renewals, Dodo Payments applies this classification automatically. Subscription Payment Retries re-attempt soft declines. A hard decline ends the retry chain immediately; recover it with Subscription Dunning.
Never reveal the real reason for STOLEN_CARD, LOST_CARD, PICKUP_CARD, or FRAUDULENT to the customer. Revealing these reasons can alert a fraudulent actor. Show the customer a generic decline message (for example, “Your card was declined. Please contact your bank or use another card.”), and log the specific code only internally.Dodo Payments applies this rule on the surfaces it controls. For these four codes, checkout, the Customer Portal, and dunning emails show a generic decline message, while your merchant copy keeps the real reason. Apply the same rule anywhere you show error_message from the merchant API to a customer.

Transaction Failure Reasons

The following table lists every failure code with its decline type, whether the customer can resolve it, a description, and the recommended action.
User Error shows whether the customer can resolve the decline. Yes means the customer can fix the issue, for example by entering correct card details. No means a system-level issue or a bank restriction caused the decline, and the customer can’t resolve it directly.
An issuing bank can also decline a card because its own risk engine flags the cardholder as high-risk, independent of the merchant or the transaction details. These declines usually appear as generic codes such as DO_NOT_HONOR, GENERIC_DECLINE, CARD_DECLINED, TRANSACTION_NOT_APPROVED, or FRAUDULENT. The bank doesn’t share the specific reason, and neither Dodo Payments nor the merchant can override the decision. Ask the customer to contact their bank to resolve the flag, or to use a different card or payment method.

Handling Failures Programmatically

Read error_code from the payment.failed webhook or the payment object, map it to the recommended action in the table, and decide whether to retry. For subscription renewals, Dodo Payments retries soft declines for you. See Subscription Payment Retries. For API and business-logic errors that are not card declines, such as PAYMENT_NOT_SUCCEEDED or REFUND_WINDOW_EXPIRED, see the Error Codes reference.

Handle Payment Failures

End-to-end guide to detecting, surfacing, and retrying failed payments.

Error Codes

API and business-logic error codes for non-decline failures.

Subscription Payment Retries

Automatic retries that recover soft declines on subscription renewals.

Subscription Dunning

Email sequences that recover hard declines by prompting a payment method update.

Support

For more help with transaction failures or integration issues, contact the support team at support@dodopayments.com.
Last modified on September 26, 2026