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
FailorDeniedevents (see Handle Event Notifications).
Handle the event
To implement this recovery logic in your application:
- Listen for
FailorDeniedevents with error code331("Not enough balance"). - Check the payload for the
suggestedRetryAmountfield. - 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"
}Updated 1 day ago