This endpoint enables you to fetch all your account transactions. You can pass in pagination parameters as illustrated below.
https://darajapay.com/api/v1/transactions
| Name | Type | Description |
|---|---|---|
| page | Integer | The page number that you want to fetch data for |
| per | Integer | The total records per page |
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Basic authToken |
{
"transactions": [
{
"id": 451,
"account_id": 183,
"invoice_id": null,
"transaction_type": "service_charge",
"description": "Received KES 50 from ",
"amount": -6,
"transaction_reference": "EB7C4Z7RXC",
"provider_reference": "cost_EB7C4Z7RXC",
"goal_id": null,
"gateway": "sasapay",
"cost": 6,
"wallet_balance": 6775,
"transaction_name": "Transaction Fee",
"created_at": "2024-01-19T15:13:11.203273Z",
"updated_at": "2024-01-19T15:13:11.202741Z"
},
{
"id": 450,
"account_id": 183,
"invoice_id": null,
"transaction_type": "outbound_payment",
"description": "Received KES 50 from ",
"amount": 50,
"transaction_reference": "EB7C4Z7RXC",
"provider_reference": "EB7C4Z7RXC",
"goal_id": null,
"gateway": "sasapay",
"cost": 6,
"wallet_balance": 6775,
"transaction_name": "Outbound Payment",
"created_at": "2024-01-19T15:13:11.198821Z",
"updated_at": "2024-01-19T15:13:11.19815Z"
}
],
"pagination": {
"count": 284,
"next_page": 3,
"num_pages": 142,
"page": 2,
"per": 2,
"prev_page": 1
}
}
From the response you can pick the next_page and prev_page params to help you navigate easily, You also get a count of all the available transactions
<?php
$url = 'https://darajapay.com/api/v1/transactions';
$headers = array(
'Content-Type: application/json',
'Authorization: Basic YOUR_API_KEY'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;