Settlements
The SettlementResource allows you to gain insights into payouts made by Paystack to your bank account. You can list settlements and view the transactions that make up a specific settlement.
List Settlements
List settlements made to your settlement accounts.
php
// List all settlements
$settlements = paystack()->settlement()->list();
// Filter settlements
$filtered = paystack()->settlement()->list([
'status' => 'success',
'from' => '2023-01-01',
'to' => '2023-12-31'
]);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
perPage | Integer | No | Specify how many records you want to retrieve per page. Defaults to 50. |
page | Integer | No | Specify exactly what page you want to retrieve. Defaults to 1. |
status | String | No | Fetch settlements based on their state. Values: success, processing, pending, failed. |
subaccount | String | No | Provide a subaccount ID to export only settlements for that subaccount. |
from | Date | No | A timestamp from which to start listing settlements. |
to | Date | No | A timestamp at which to stop listing settlements. |
List Settlement Transactions
Get the transactions that make up a particular settlement.
php
$settlementId = 3090024;
$transactions = paystack()->settlement()->transactions($settlementId, [
'perPage' => 20
]);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | String | Yes | The settlement ID. |
perPage | Integer | No | Specify how many records you want to retrieve per page. |
page | Integer | No | Specify exactly what page you want to retrieve. |
from | Date | No | A timestamp from which to start listing transactions. |
to | Date | No | A timestamp at which to stop listing transactions. |
Use Cases
Reconciling Payouts
You can use the transactions method to reconcile the total amount settled to your bank account with the individual transactions processed on your site.
php
$settlementId = 3090024;
$settlementTransactions = paystack()->settlement()->transactions($settlementId);
$totalCalculated = 0;
foreach ($settlementTransactions['data'] as $transaction) {
$totalCalculated += $transaction['amount'];
}
// Compare $totalCalculated with the settlement totalTracking Pending Settlements
Monitor settlements that are yet to be paid out.
php
$pendingSettlements = paystack()->settlement()->list([
'status' => 'pending'
]);