Get Ledger Entries
Retrieve paginated ledger entries (double-entry bookkeeping records) with optional filters.
GET
https://api.zenpayz.com/merchant/api/v1/ledger/entriesBearer · API key
Request
Headers
| Header | Description |
|---|---|
Authorization REQUIRED | Bearer {api_key} |
X-Signature REQUIRED | HMAC-SHA256 signature |
X-Timestamp REQUIRED | ISO 8601 timestamp |
X-Secret-Salt REQUIRED | Secret salt for HMAC validation |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page OPTIONAL | integer1 | Page number |
limit OPTIONAL | integer20 | Items per page (max 100) |
startDate OPTIONAL | string- | Filter from date (YYYY-MM-DD) |
endDate OPTIONAL | string- | Filter to date (YYYY-MM-DD) |
currency OPTIONAL | string- | Filter by currency code |
entryType OPTIONAL | string- | Filter by type: DEBIT or CREDIT |
Response
Success (200 OK)
{
"success": true,
"data": {
"entries": [
{
"entryId": "le_xxxxx",
"batchId": "batch_xxxxx",
"accountId": "acc_xxxxx",
"merchantId": "mer_xxxxx",
"entryType": "CREDIT",
"entryCategory": "DEPOSIT_NET",
"amount": 950,
"currency": "INR",
"balanceBefore": 9050,
"balanceAfter": 10000,
"sourceType": "PAYMENT",
"sourceTransactionId": "txn_xxxxx",
"sourceOrderId": "order_xxxxx",
"description": "Payment deposit (net after fees)",
"postedAt": "2024-01-15T10:30:00.000Z",
"createdAt": "2024-01-15T10:30:00.000Z"
},
{
"entryId": "le_yyyyy",
"batchId": "batch_xxxxx",
"accountId": "acc_xxxxx",
"merchantId": "mer_xxxxx",
"entryType": "DEBIT",
"entryCategory": "PAYOUT",
"amount": 5000,
"currency": "INR",
"balanceBefore": 15000,
"balanceAfter": 10000,
"sourceType": "PAYOUT",
"sourceTransactionId": "po_xxxxx",
"description": "Payout withdrawal",
"postedAt": "2024-01-15T09:00:00.000Z",
"createdAt": "2024-01-15T09:00:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 150,
"totalPages": 8,
"hasNext": true,
"hasPrev": false
},
"total": 150
},
"message": "Ledger entries retrieved successfully"
}
Entry Types
| Type | Description |
|---|---|
DEBIT | Decrease in account balance |
CREDIT | Increase in account balance |
Entry Categories
| Category | Description |
|---|---|
DEPOSIT_GROSS | Gross deposit amount before fees |
DEPOSIT_NET | Net deposit amount after fees |
DEPOSIT_FEE | Fee deducted from deposit |
PAYOUT | Payout withdrawal |
PAYOUT_FEE | Payout processing fee |
REFUND | Refund to customer |
CHARGEBACK | Chargeback deduction |
SETTLEMENT | Settlement transfer |
RESERVE_ALLOCATION | Reserve allocation |
RESERVE_RELEASE | Reserve release |
Examples
- cURL
- SDK
curl -X GET "https://api.zenpays.com/merchant/api/v1/ledger/entries?page=1&limit=20¤cy=INR&entryType=CREDIT" \
-H "Authorization: Bearer zp_test_xxxxx" \
-H "X-Timestamp: 2024-01-15T10:30:00.000Z" \
-H "X-Signature: a1b2c3d4e5f6..." \
-H "X-Secret-Salt: your_secret_salt"
const { entries, pagination } = await zenpays.ledger.getEntries({
page: 1,
limit: 20,
currency: 'INR',
entryType: 'CREDIT'
});
entries.forEach(entry => {
console.log(`${entry.entryType}: ${entry.amount} ${entry.currency} - ${entry.description}`);
});