132 lines
3.8 KiB
Markdown
132 lines
3.8 KiB
Markdown
# Transaction History
|
|
|
|
Fetch paginated transaction history for a single MIB account. Served from the encrypted API.
|
|
|
|
The account must belong to the **currently selected** profile — call `P47` for its profile first (see [03-accounts.md](03-accounts.md)).
|
|
|
|
---
|
|
|
|
## Transaction History — `sfunc=n`, `routePath: A84`
|
|
|
|
**Key**: session key
|
|
|
|
**Request**:
|
|
```json
|
|
{
|
|
"sfunc": "n",
|
|
"xxid": "<session xxid>",
|
|
"data": {
|
|
"accountNo": "90101000000001000",
|
|
"start": 0,
|
|
"end": 19,
|
|
"includeCount": true,
|
|
"trxType": 0,
|
|
"sortTrx": "date",
|
|
"sortDir": "desc",
|
|
"nonce": "<computed nonce>",
|
|
"appId": "<appId>",
|
|
"sodium": "<random 20-bit int>",
|
|
"routePath": "A84",
|
|
"xxid": "<session xxid>"
|
|
}
|
|
}
|
|
```
|
|
|
|
| Field | Example | Description |
|
|
|---|---|---|
|
|
| `accountNo` | `90101000000001000` | Account number to fetch history for |
|
|
| `start` | `0` | First row (0-based, inclusive) |
|
|
| `end` | `19` | Last row (inclusive) |
|
|
| `includeCount` | `true` | Include `total_count` in response |
|
|
| `trxType` | `0` | Transaction type filter (`0` = all) |
|
|
| `sortTrx` | `date` | Sort field |
|
|
| `sortDir` | `desc` | Sort direction |
|
|
|
|
### Pagination
|
|
|
|
Page size is 20. Compute `start`/`end` per page:
|
|
|
|
| Page | `start` | `end` |
|
|
|---|---|---|
|
|
| 1 | `0` | `19` |
|
|
| 2 | `20` | `39` |
|
|
| N | `(N-1)*20` | `N*20 - 1` |
|
|
|
|
Stop when total fetched equals `total_count` or `data` is empty.
|
|
|
|
---
|
|
|
|
## Response
|
|
|
|
```json
|
|
{
|
|
"success": true,
|
|
"responseCode": "1",
|
|
"reasonCode": "103",
|
|
"reasonText": "Trx History Retrieval Success!",
|
|
"total_count": "87",
|
|
"pos": "0",
|
|
"data": [
|
|
{
|
|
"accountNo": "90101000000001000",
|
|
"curCode": "462",
|
|
"curCodeDesc": "MVR",
|
|
"trxNumber": "1-158043140-93434633-1",
|
|
"trxNumber2": "93434633",
|
|
"trxDate": "2026-05-16 15:10:25",
|
|
"trxValDate": "2026-05-16 00:00:00",
|
|
"absAmount": "500",
|
|
"baseAmount": "-500",
|
|
"foreignAmount": "-500",
|
|
"descr1": "Favara Transfer Web",
|
|
"descr2": "<reference>",
|
|
"descr3": "<details>",
|
|
"remarks": "<details>",
|
|
"trxType": "803",
|
|
"AddDate": "2026-05-16 15:10:25",
|
|
"bankCode": "1",
|
|
"bankName": "Maldives Islamic Bank",
|
|
"benefName": "BML - MOHAMED ALI",
|
|
"otherAccountNo": "-",
|
|
"fromAcc": null,
|
|
"imageHash": null,
|
|
"bankColor": "#FE860E"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
| Field | Type | Description |
|
|
|---|---|---|
|
|
| `success` | `bool` | `true` on success |
|
|
| `total_count` | `string` | Total transaction count — parse to `int` |
|
|
| `pos` | `string` | Echo of the requested start row |
|
|
| `data` | `array` | Transactions for this page |
|
|
|
|
### Transaction Object
|
|
|
|
| Field | Consumed | Description |
|
|
|---|---|---|
|
|
| `trxNumber` | yes | Unique transaction ID |
|
|
| `trxDate` | yes | Transaction timestamp (`yyyy-MM-dd HH:mm:ss`) |
|
|
| `descr1` | yes | Transaction description — trim whitespace |
|
|
| `foreignAmount` | yes | Amount in the **account's** currency — **negative = debit, positive = credit** |
|
|
| `curCodeDesc` | yes | Account currency (e.g. `"MVR"`, `"USD"`) |
|
|
| `benefName` | yes | Counterparty name — `null`, blank or literal `"null"` means none |
|
|
| `trxNumber2` | yes | Secondary reference; may be blank |
|
|
| `baseAmount` | server-only | Signed amount in MVR. Differs from `foreignAmount` on USD accounts. |
|
|
| `absAmount` | server-only | Unsigned MVR amount |
|
|
| `descr2` / `descr3` / `remarks` | server-only | Extra reference and narrative lines |
|
|
| `trxType` | server-only | Numeric transaction type (e.g. `800` Favara credit, `803` Favara transfer, `205` account-to-account) |
|
|
| `imageHash` | server-only | Counterparty image hash, fetchable via `P41` (see [07-profile.md](07-profile.md)) |
|
|
|
|
> On USD accounts `baseAmount` is the MVR equivalent — always use `foreignAmount` for the amount shown against the account.
|
|
|
|
---
|
|
|
|
|
|
|
|
---
|
|
|
|
[← Accounts](03-accounts.md) **Next →** [Cards](05-cards.md)
|