API response body
{
"records": [
{
"id": "dd9bfad8a88f838d53f63b85c109dcf1",
"timestamp": "2021-10-08T10:41:25+00:00",
"institution_id": "mpesa",
"account_id": "default",
"account_type": "depository",
"amount": 6800.0,
"balance": 6324.13,
"currency": "KES",
"impact": "DEBIT",
"labels": []
},
{
"id": "fd5476336f8cd261e394c050ccfff038",
"timestamp": "2021-09-24T06:31:23+00:00",
"institution_id": "mpesa",
"account_id": "default",
"account_type": "depository",
"amount": 4359.0,
"balance": 4359.0,
"currency": "KES",
"impact": "CREDIT",
"labels": []
}
]
}
Summary
A "Ledger record" is a financial event that is capturing either a transaction's information, balance information or an alert information (or a combination of these events) of a user with one of their associated institutions.
Query/Response Behavior
If no time range is provided in the query, the endpoint defaults to returning a full history of ledger records, ordered in descending timestamp.
Fields
records[].id
Refers to the ID of the record from the source it's being retrieved from
records[].institution_id
A user can have accounts with multiple institutions. This field will help differentiate records associated with one institution from another.
records[].account_id
Multiple accounts can be associated with an institution. The Ledger endpoint returns the entire collection of records, across all possible accounts across all associated institutions. In this example, these are records belonging to the user's institution Zenith Bank (institution_id = "mpesa"
). It is possible that a user has multiple accounts (e.g. a savings and a checking), in which case Pngme attempts to extract the distinct account_id
of each account. _If the account_id
value is not extractable, this field shows as "account_id": "default"
.
records[].account_type
The type of account associated with the set of records. See more Account Types.
records[].timestamp
The time at which the financial event occurred (specifically, when the SMS was received at the mobile phone user's phone).
records[].amount
The amount of the credit or debit transaction. Could be null
.
records[].impact
The direction of cash flow for the specific record. Could be null
.
Valid values include one of:
CREDIT
DEBIT
A CREDIT
for a loan
type account or revolving_loan
type account is a repayment towards the loan.
A DEBIT
for a loan
type account is a record of disbursement following the loan approval.
A CREDIT
for a depository
type account is cash-in.
A DEBIT
for a depository
type account is cash-out.
records[].balance
The balance associated with the account_id
of the institution_id
. Could be null
.
records[].currency
A currency field, if available. Currency is not always extractable for a given ledger record.
If present, currency
is one of the recognized currency codes, as detailed in the Currency Codes section.
records[].labels[]
One or more labels associated with the given ledger record. See the Labels section for a list of recognized labels, and their description. See more Labels.