API Reference

Ledger bank transactions

Endpoints

All the endpoints related to bank transactions in the bank account ledgers need a specific bank_account in the path.

GET /v1/bank-accounts/<bank_account_id>/ledger-transactions/
GET /v1/bank-accounts/<bank_account_id>/ledger-transactions/:id/
POST /v1/bank-accounts/<bank_account_id>/ledger-transactions/
PATCH /v1/bank-accounts/<bank_account_id>/ledger-transactions/:id/
DELETE /v1/bank-accounts/<bank_account_id>/ledger-transactions/:id/

Ledger bank transaction object

Ledger bank transactions are accounting transactions using the bank account. They can be manual, in the sense that they were created by a user (for instance to start from a specific balance). They are not manual when the system generated them, because an invoice / expense / bill used the bank account as the paid through account.

AttributeTypeDescription
idstringid of the ledger bank transaction
bank_accountstring(Readonly) id of the bank account
accountstringid of the account
datestringThe date of the transaction
amountnumberThe transaction amount
descriptionstringA description attached to the transaction
referencestringA reference attached to the transaction
is_manualboolean(Readonly) True when the transaction was created by a user

Example

{
    "id": "bt_KabEvYZwpUQCevDJycmVWu",
    "bank_account": "ba_9t79bCG2Q6SxPxQBqva8z9",
    "account": "acc_x908asdlmn298123lnm",
    "date": "2019-12-29",
    "amount": 1000.0,
    "description": "Set bank account initial balance",
    "reference": "",
    "is_manual": true
}

List ledger bank transactions

GET /v1/bank-accounts/<bank_account_id>/ledger-transactions/

Request

curl --location \
    --request GET 'https://api.wafeq.com/v1/bank-accounts/<bank_account_id>/ledger-transactions/' \
    --header 'Authorization: Api-Key <api_key>' \
    --header 'Content-Type: application/json'

Filters

Query paramPossible valuesDescription
accountstringThe identifier of the account.
date_afterstringTransactions that are booked on or after the date.
date_beforestringTransactions that are booked before the date.
amount_minnumberTransactions with this minimum amount.
amount_maxnumberTransactions with this maximum amount.

Request

curl --location \
    --request GET 'https://api.wafeq.com/v1/bank-accounts/<bank_account_id>/ledger-transactions/?amount_max=0' \
    --header 'Authorization: Api-Key <api_key>' \
    --header 'Content-Type: application/json'

Create ledger bank transactions

POST /v1/bank-accounts/<bank_account_id>/ledger-transactions/

Request body

AttributeTypeDescription
datestringThe date of the transaction
accountstringThe id of the account
amountnumberThe transaction amount
descriptionstringA description attached to the transaction
referencestringA reference attached to the transaction

Update ledger bank transaction

PATCH /v1/bank-accounts/<bank_account_id>/ledger-transactions/:id/

You can only update ledger bank transactions that have is_manual set to true.

Request body

AttributesTypeDescription
datestringThe date of the transaction
accountstringThe id of the account
amountnumberThe transaction amount
descriptionstringA description attached to the transaction
referencestringA reference attached to the transaction

Delete ledger bank transactions

DELETE /v1/bank-accounts/<bank_account_id>/ledger-transactions/:id/
Previous
Statement bank transactions