Callback URL Configuration

OGateway supports separate webhook URLs for successful and failed transactions, giving you granular control over how you handle different transaction outcomes.

How It Works

You can configure two callback URLs:

URL TypeDashboard FieldAPI ParameterDescription
Success Callback URLSuccessful Transactions Webhook URLcallbackURLReceives callbacks for COMPLETED transactions
Failure Callback URLFailed Transactions Webhook URLfailureCallbackURLReceives callbacks for FAILED transactions

Setting Callback URLs

There are two ways to configure your callback URLs:

1. Account-Level (Dashboard)

Set default callback URLs for your entire business account via the dashboard:

  • Successful Transactions Webhook URL: Receives all successful transaction callbacks
  • Failed Transactions Webhook URL: Receives all failed transaction callbacks

[NOTE] If only the Success Callback URL is set but no Failure Callback URL, failed transaction callbacks will also be sent to the Success Callback URL as a fallback.

2. Per-Request (API)

Override the account-level defaults on a per-transaction basis by passing the URLs in your API request payload:

{
  "amount": 10,
  "reason": "Payment for services",
  "accountName": "Bernard Danso",
  "accountNumber": "0249123456",
  "currency": "GHS",
  "network": "MTN",
  "reference": "unique-ref-123",
  "callbackURL": "https://your-domain.com/webhooks/success",
  "failureCallbackURL": "https://your-domain.com/webhooks/failure"
}

[IMPORTANT] If a callbackURL or failureCallbackURL is passed in the API request, it overrides the corresponding account-level default for that specific transaction.

URL Resolution Priority

The system determines which URL to send the callback to using this priority:

For Successful (COMPLETED) Transactions:

  1. callbackURL passed in the API request payload
  2. Success Callback URL set on the dashboard
  3. No callback sent if neither is set

For Failed Transactions:

  1. failureCallbackURL passed in the API request payload
  2. Failure Callback URL set on the dashboard
  3. Falls back to callbackURL / Success Callback URL
  4. No callback sent if none of the above are set

[TIP] If you don't need to separate your callbacks, simply set only the Success Callback URL — it will be used for both successful and failed transactions.

Quick Reference

ScenarioCOMPLETED sent toFAILED sent to
Only callbackURL setcallbackURLcallbackURL
Both URLs setcallbackURLfailureCallbackURL
Neither setNo callbackNo callback
Per-request override with failureCallbackURLAccount defaultPer-request failureCallbackURL

Updated Fields Table Entry

ParameterTypeNullableDescription
failureCallbackURLStringYesThe URL to receive callbacks for failed transactions. If not set, failed callbacks fall back to callbackURL. Can be set per-request or at account level via dashboard.

Sample Payloads

{
  "amount": 22,
  "reason": "Payment for services",
  "accountName": "Bernard Danso",
  "accountNumber": "0249123456",
  "currency": "GHS",
  "network": "MTN",
  "reference": "d20d4d8df15712345432",
  "callbackURL": "https://your-domain.com/webhooks/success",
  "failureCallbackURL": "https://your-domain.com/webhooks/failure"
}
{
  "recipients": [
    {
      "amount": 22,
      "network": "MTN",
      "accountName": "Bernard Danso",
      "accountNumber": "0249123456",
      "currency": "GHS"
    }
  ],
  "reference": "d20d4d8df15712345432",
  "callbackURL": "https://your-domain.com/webhooks/success",
  "failureCallbackURL": "https://your-domain.com/webhooks/failure"
}

[NOTE] The callback payloads (what OGateway sends to your URL) remain the same as documented — the only difference is which URL they are sent to.