Accept Payment
BudPay Standard

BudPay Standard (Redirect)

BudPay Standard sends your customer to a secure, BudPay-hosted payment page. You create the transaction from your server, redirect the customer, and BudPay returns them to your site when the payment is complete. No payment UI or frontend library is required.

How it works

  1. Initialize the transaction. Your server calls the Initialize Transaction API and receives a payment link (authorization_url).
  2. Redirect the customer. Send the customer to the payment link to complete the payment.
  3. Receive the customer back. BudPay redirects the customer to your callback URL with the reference and status.
  4. Verify the payment. Confirm the result on your server before you give value.

Step 1: Initialize the Transaction

From your server, call the Initialize Transaction API with the customer's email, the amount, and your callback URL. The request is authenticated with your secret key.

Endpoint: POST https://api.budpay.com/api/v2/transaction/initialize

1curl -X POST 'https://api.budpay.com/api/v2/transaction/initialize' \2  -H 'Content-Type: application/json' \3  -H 'Authorization: Bearer YOUR_SECRET_KEY' \4  -d '{5  "email": "customer@email.com",6  "amount": "20000",7  "currency": "NGN",8  "callback": "https://yoursite.com/payment/callback"9}'
{  "status": true,  "message": "Authorization URL created",  "data": {    "authorization_url": "https://www.budpay.com/checkout/wp5goiyvc1pt",    "access_code": "wp5goiyvc1pt",    "reference": "REF_61e469c330c2bc"  }}
Headers
ParameterDescription
URLhttps://api.budpay.com/api/v2/transaction/initialize
MethodPOST
AuthorizationBearer YOUR_SECRET_KEY. Use your BudPay secret key.
Content-Typeapplication/json
Request Body
ParameterTypeRequiredDescription
emailstringYesCustomer's email address.
amountstringYesAmount to charge, e.g. "20000". Leave this out when creating a subscription.
callbackstringYesURL BudPay redirects the customer to after payment. reference and status are added as query parameters, e.g. https://yoursite.com/callback?reference=REF_123&status=success.
currencystringNoCurrency code: NGN, GHS, KES or USD. Defaults to NGN.
referencestringNoUnique, case-sensitive transaction reference. Only alphanumeric characters and -, _, . and = are allowed. BudPay generates one if you leave it out.
⚠️

This request uses your secret key. Always make it from your server, never from the browser.


Step 2: Redirect the Customer

Redirect the customer to data.authorization_url from the response. The customer completes the payment on BudPay's hosted payment page.

BudPay hosted payment page

Step 3: Handle the Result

When the customer completes the payment:

  • Redirect: BudPay redirects the customer to your callback URL with reference and status as query parameters.
  • Webhook: If you have configured a webhook URL, BudPay sends the transaction details to it. See Webhooks.
  • Merchant notification: BudPay emails you the transaction details.
  • Customer receipt: BudPay emails the customer a receipt.
⚠️

The redirect to your callback URL does not confirm payment, because query parameters can be changed by anyone. Always verify the transaction on your server before you give value.


Verifying Transactions

Call the Verify Transaction API with the transaction reference:

GET https://api.budpay.com/api/v2/transaction/verify/:reference

Example Request:

Endpoint: GET https://api.budpay.com/api/v2/transaction/verify/BUD_1673600359168063493

1curl -X GET 'https://api.budpay.com/api/v2/transaction/verify/BUD_1673600359168063493' \2  -H 'Authorization: Bearer YOUR_SECRET_KEY'
{  "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:

  1. Receive callback/webhook with transaction reference
  2. Call Verify API (server-side)
  3. Check status === "success"
  4. Verify amount matches expected
  5. Fulfill order/deliver service

Learn more about verifying transactions.


Handling Webhooks

Webhooks let BudPay notify your server when a payment is completed, even if the customer closes their browser before the redirect. Use them to update orders, send confirmation emails, or trigger fulfilment. See Webhooks to set up and secure your endpoint.