Transfer Control
The TransferControlResource allows you to manage settings for your transfers, including checking balances, fetching ledgers, and managing OTP requirements for transfers.
Check Balance
Fetch the available balance on your integration.
$balance = paystack()->transferControl()->checkBalance();
foreach ($balance['data'] as $currencyBalance) {
echo "Currency: " . $currencyBalance['currency'] . "\n";
echo "Balance: " . $currencyBalance['balance'] . "\n";
}Fetch Balance Ledger
Fetch all pay-ins and pay-outs that occurred on your integration.
// List ledger entries
$ledger = paystack()->transferControl()->fetchLedger();
// Filter ledger
$filtered = paystack()->transferControl()->fetchLedger([
'perPage' => 20,
'page' => 1
]);Resend OTP
Generates a new OTP and sends it to the business phone number. This is useful if you are performing a transfer that requires OTP validation and the initial OTP was not received.
$transferCode = 'TRF_vsyqdmlzble3uii';
$response = paystack()->transferControl()->resendOtp($transferCode, 'resend_otp');Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
transfer_code | String | Yes | The code for the transfer. |
reason | String | No | Either resend_otp or transfer. Defaults to resend_otp. |
Disable OTP Request
Request to disable the OTP requirement for transfers. Paystack will send an OTP to the business phone to verify this request.
Note: Disabling OTP allows you to complete transfers programmatically without manual intervention.
$response = paystack()->transferControl()->disableOtpRequest();Finalize Disable OTP
Finalize the request to disable OTP on your transfers using the OTP sent to your business phone.
$otp = '123456'; // OTP received on business phone
$response = paystack()->transferControl()->disableOtpFinalize($otp);Enable OTP
Re-enable the OTP requirement for transfers.
$response = paystack()->transferControl()->enableOtp();Use Cases
Monitoring Cash Flow
You can use the fetchLedger method to build a dashboard showing the inflow and outflow of funds in your Paystack integration.
$ledger = paystack()->transferControl()->fetchLedger();
foreach ($ledger['data'] as $entry) {
$amount = $entry['amount'];
$type = $entry['model_responsible']; // Transaction, Transfer, Refund, etc.
$reason = $entry['reason'];
// Process and display entry
}Automating Payouts
If you need to automate payouts to vendors or partners, you likely want to disable OTPs so your script can run without human intervention.
- Call
disableOtpRequest()to trigger an OTP to your phone. - Receive the OTP.
- Call
disableOtpFinalize($otp)to confirm. - Now you can use the Transfer Resource to send money programmatically.
