Retry payment with a lower amount
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) or exceeds threshold (SW054), the Deny 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 events with a
paymentProviderTransaction.statusofSW021orSW054and a populatedsuggestedRetryAmountfield. - 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 15 days ago