Checking balance before payment
Overview
You can fetch the realtime balance of the account that an authorised Account-on-file consent is linked to using the GET /consents/v1/{consent_id}/balance endpoint.
Common use cases
- Displaying available funds in your checkout or payment screen so the end user can confirm they have sufficient balance before paying.
- Showing account balance in a wallet or account management view within your application.
- Pre-validating payment amounts on the client side to reduce payment failures due to insufficient funds.
How it works
- The end user has an existing Account-on-file consent in authorised status.
- You call
GET /consents/v1/{consent_id}/balancewith the consent ID. - Lean retrieves the current balance from the bank for the account linked to that consent.
- You receive the balance value and currency in the response.
curl -X GET "https://sandbox.leantech.me/consents/v1/{consent_id}/balance" \
-H "Authorization: Bearer YOUR_JWT" \
-H "lean-app-token: {your_app_token}"{
"currency": "AED",
"balance": 2500
}No additional consent, permissions, or SDK interaction is needed. The endpoint is a sub-resource of the consent, so access is scoped to the specific account the end user originally authorised.
Updated 1 day ago
What’s Next
