Skip to main content

Transaction

Accept payments, verify transaction statuses, and retrieve transaction history via $paystack->transaction.

Initialize a Transaction​

Start a payment session and retrieve an authorization URL to redirect your customer to Paystack's checkout.

$response =$paystack->transaction->initialize([
'email' => 'customer@example.com',
'amount' => 500000, // NGN 5,000.00 in kobo
'callback_url' => 'https://example.com/payment/callback',
]);
Amount Calculation

The amount parameter must be passed in the lowest currency denomination (kobo for NGN, pesewas for GHS, cents for USD/ZAR). For example, pass 500000 for NGN 5,000.00.


Verify a Transaction​

Confirm the final status of a transaction using its unique reference after the customer completes checkout or via webhook.

$response =$paystack->transaction->verify('7PVGX8MEk85tgeEpVDtD');
Always Verify Server-Side

Never rely solely on frontend redirect callbacks to fulfill orders. Always call $paystack->transaction->verify($reference) on your server and check that $response->data->status === 'success' and the returned amount matches your expected order total.


List Transactions​

Retrieve a paginated list of transactions carried out on your integration.

$response =$paystack->transaction->list([
'perPage' => 20,
'page' => 1,
]);
ParameterTypeDescription
perPageintNumber of records to retrieve per page (default: 50).
pageintPage number to retrieve (default: 1).
customerintFilter transactions by a specific customer ID.
statusstringFilter by transaction status (failed, success, abandoned).

Fetch a Single Transaction​

Get full details of a specific transaction using its numeric Paystack transaction ID.

$response =$paystack->transaction->fetch(2009945086);