API / Reference / Bank Accounts
Upsert bank account balance
PUT
https://api.light.inc/v1/bank-accounts/{bankAccountId}/balance
Creates or updates the opening balance for a bank account. Only one balance per bank account is allowed — subsequent calls update the existing balance.
This stores a closing (end-of-day) balance, not an opening one. balanceAt is normalised to 23:59:59 UTC of its day, and transactions dated on or before that day are treated as already included in the balance; only later transactions are added on top. So give the statement balance at the end of that day, and load transactions dated after it. A second call replaces both balance and balanceAt for the account.
Authorization
Send one of these on every request. See Authentication for how to get credentials.
- API key
Basic authentication header of the form Basic <api_key>, where <api_key> is your api key.
- Bearer token
Path parameters
-
bankAccountIdstring · uuidrequired
Request body
application/json;charset=UTF-8
-
balanceAtstring · date-timeTimestamp of the balance (opening balance date). Defaults to current timestamp if not provided.
A closing (end-of-day) point: the time of day is discarded and transactions dated that day or earlier count as already included in
balance. -
balanceinteger · int64requiredBalance amount in minor units (e.g. cents)
Response
-
idstring · uuidUnique identifier for the bank account balance
-
bankAccountIdstring · uuidID of the bank account
-
balanceAtstring · date-timeTimestamp of the balance (opening balance date)
-
balanceinteger · int64Balance amount in minor units (e.g. cents)