There are many ways to know your balance. But we cannot, and should not, know when your account has a low balance since that will depend on your business rules. Anyhow, there are several ways to know your balance:
1.- By going to your UNNAX Portal Accounts > Statements
2.- Using our API for Accounts Detail. https://sandbox.unnax.com/3.0/accounts/account-detail
The response received from this endpoint will bring several information about your account. Among them you can find the account balance.
{
"account_number": "ES9****************143",
"updated": "2017-05-26 14:17:42",
"account_hash": "3559******************503",
"id": 25,
"bank_data": {
"bank_type": 999,
"bank_state": true,
"bank_read": true,
"can_fast_transfer": true,
"bank_transfer": true
},
"name": "Cuenta Caixa Formulario",
"displayed": true,
"login_data": false,
"state": 1,
"pending_balance": 0,
"credential_id": 171,
"current_balance": 0,
...
}
3.- After each confirmed payout transaction, if you have configured the event webhook “event_payment_transfer_auto_processed”, you will receive a callback that will include the balance of the account after the transaction has been confirmed
{ "response_id": "bd9602**********************b10ad", "signature": "f5f519615****************46954ba4887be67d", "date": "2018-09-25 11:01:32", "service": "auto_transfer", "triggered_event": "event_payment_transfer_auto_processed", "environment": "unnax_integration_aws", "data": { "success": true, "product": "movex_dbt", "order_id": "1537873308", "bank_order_id": "1537873308", "date": "2018-09-25", "time": "11:01:32", "amount": 15500, "currency": "EUR", "customer_id": "1", "customer_account": "ES*******************17", "source_account": "ES******************22", "src_account_balance": 5228, "cancelled": false, "source_bank_id": 3 }, "trace_identifier": "1537873308" }
With this information you will be able to trigger any automatic response when your balance has reached a threshold.
4.- You can also get notifications from your account, when it has gone below a threshold, by registering a Webhook for the event_low_balance_threshold
event. You could receive notifications via email or callback and it will be triggered once the account reaches the configured threshold.