Server to Server (Bank Transfer)
This guide provides an overview of BudPay's Bank Transfer API, which allows you to generate account details for customers to make payments via bank transfer.
Quick overview
- Generate Bank account Details: Use the Bank Transfer
initializeAPI to generate account details for customers to make payments via bank transfer. - Customer transfers to the generated account: Customers make payment to the generated account using the account details provided.
- Webhook notification: BudPay sends a webhook notification to your server when the payment is received.
- Check payment status: Verify the payment status using the
verifyendpoint.
Step 1: Generate Bank account Details
Use the initialize endpoint to generate account details for customers to make payments via bank transfer.
curl https://api.budpay.com/api/s2s/banktransfer/initialize
-H "Authorization: Bearer YOUR_SECRET_KEY"
-H "Content-Type: application/json"
-d '{ "email": "test@test.com", "amount": "100", "currency" :"NGN", "reference": "1253627873656276350", "name": "Business Name / Firstname lastname" }'
-X POSTRequest Parameters
email: Customer's email address.amount: Amount to be paid.currency: Currency of the payment.reference: Unique reference for the transaction.name: Business name or customer's name.
Response
{
"status": true,
"message": "Account generated successfully",
"data": {
"account_name": "Business Name / Firstname lastname",
"account_number": "1014692362",
"bank_name": "BudPay Bank"
}
}Try it out
Step 2: Customer transfers to the generated account
Provide the account details generated in step 1 to the customer to make payment via bank transfer.
Step 3: Webhook notification
We will send a webhook notification to the URL provided in your BudPay dashboard. when the payment is received. You can use the webhook to update the payment status in your system. The webhook payload will look like this:
{
"notify": "transaction",
"notifyType": "successful",
"data": {
"id": 1050471,
"currency": "USD",
"amount": "5.22",
"reference": "482208088163205800",
"ip_address": null,
"channel": "card",
"type": "transaction",
"domain": "live",
"fees": "0.19836",
"plan": null,
"requested_amount": "5.22",
"status": "success",
"card_attempt": 1,
"settlement_batchid": null,
"message": "Approved",
"metadata": "MID: DPPSPBDNG|15173|5399|CAPTURED|Approved|SUCCESS|520149xxxxxx1019|MASTERCARD|2022-08-08T12:59:17.516Z|2022-08-08|175714|USD|222012015173|13203834|UBAS3I01",
"created_at": "2022-08-08T12:58:09.000000Z",
"updated_at": "2022-08-08T12:59:23.000000Z",
"paid_at": "2022-08-08 13:59:23",
"customer": {
"id": 427351,
"first_name": null,
"last_name": null,
"email": "melasbah83@gmail.com",
"phone": null,
"domain": "live",
"customer_code": "CUS_6kj536tc0kx9brb",
"metadata": "{}",
"status": "active"
}
}
}Verifying Transactions
Call the Verify Transaction API with the transaction reference:
GET https://api.budpay.com/api/v2/transaction/verify/:referenceExample Request:
curl https://api.budpay.com/api/v2/transaction/verify/BUD_1673600359168063493 \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-X GETExample Response:
{
"status": true,
"message": "Transaction verified successfully",
"data": {
"currency": "NGN",
"amount": "550",
"reference": "BUD_1673600359168063493",
"status": "success",
"message": "Payment successful",
"customer": {
"email": "customer@email.com"
}
}
}Always verify transactions on your server before fulfilling orders. Never rely solely on client-side callbacks or redirects.
Verification Workflow:
- Receive callback/webhook with transaction reference
- Call Verify API (server-side)
- Check
status === "success" - Verify amount matches expected
- Fulfill order/deliver service
Learn more about verifying transactions.