Available Funds Guidance

If your application is configured for Available Funds Guidance, specific failure events may include actionable data to help you recover the transaction.

When a transaction fails due to insufficient funds (SW021), the Fail or Denied event notification may contain a suggestedRetryAmount property. This value represents a safe upper limit for a new transaction attempt based on the user's available balance.

Prerequisites

Before you can implement this recovery flow, you must ensure the following:

  • Feature Enablement: Contact your Trustly Customer Success Manager or Implementation Team to enable Available Funds Guidance for your merchant account.
  • Event Listener: You must have a webhook listener configured to receive Fail or Denied events (see Handle Event Notifications).

Handle the event

To implement this recovery logic in your application:

  1. Listen for Fail or Denied events with error code 331 ("Not enough balance").
  2. Check the payload for the suggestedRetryAmount field.
  3. Prompt the user to retry the payment with a lower amount (equal to or less than the suggested value).

Example event payload

{
  "eventType": "Deny",
  "status": "8",
  "errorCode": "331",
  "message": "Not enough balance",
  "suggestedRetryAmount": "500.00"
}