/transactions/initialize.php Payments
Initialize a payment
Creates a pending transaction and returns a hosted checkout URL. Redirect your customer to authorization_url.
amountintegerrequiredAmount in kobo (min 10000).
emailstringrequiredCustomer email.
namestringCustomer name.
referencestringYour unique reference. Generated if omitted.
callback_urlurlWhere we send the customer after payment, with ?reference=&status=
metadataobjectAny JSON you want echoed back in webhooks.
channelsarrayLimit payment methods shown: card, bank, ussd, qr, mobile_money, bank_transfer. Omit for all.
curl -X POST "https://www.silentapi.site/api/v1/transactions/initialize.php" \ -H "Authorization: Bearer $SILENTAPI_SECRET_KEY" \ -H "Content-Type: application/json" \ -d '{ "amount": 500000, "email": "ada@example.com", "name": "Ada Okafor", "reference": "order_10293", "callback_url": "https://yourapp.com/paid", "metadata": { "order_id": 10293 } }'
const res = await fetch("https://www.silentapi.site/api/v1/transactions/initialize.php", { method: "POST", headers: { "Authorization": "Bearer " + process.env.SILENTAPI_SECRET_KEY, "Content-Type": "application/json", }, body: JSON.stringify({ "amount": 500000, "email": "ada@example.com", "name": "Ada Okafor", "reference": "order_10293", "callback_url": "https://yourapp.com/paid", "metadata": { "order_id": 10293 } }), }); const json = await res.json();
$ch = curl_init("https://www.silentapi.site/api/v1/transactions/initialize.php"); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_HTTPHEADER => [ "Authorization: Bearer " . getenv("SILENTAPI_SECRET_KEY"), "Content-Type: application/json", ], CURLOPT_POSTFIELDS => json_encode([ 'amount' => 500000, 'email' => 'ada@example.com', 'name' => 'Ada Okafor', 'reference' => 'order_10293', 'callback_url' => 'https://yourapp.com/paid', 'metadata' => [ 'order_id' => 10293 ] ]), ]); $json = json_decode(curl_exec($ch), true);
{
"status": true,
"message": "Transaction initialized",
"data": {
"reference": "order_10293",
"authorization_url": "https://www.silentapi.site/api/v1/../../checkout.php?ref=order_10293",
"amount": 500000,
"fee": 7500,
"status": "pending"
}
}