Error Handling

Callback Codes

The table below contains the codes returned in the application callback / webhook payload. This is populated in the field message of the payload.

Format:

{
	//...
  "message": "Code | Fault | Message",
	//...
}

Sample output:

{
	//...
  "message": "5200 | Merchant | Invalid account number",
	//...
}

CodeFaultMessage
0000SwitchApproved
3110SwitchThe transaction failed processing at the switch - Internal Error
3120ProviderA Backend Error occurred at the payment provider
3130SwitchTransaction failed with no reason returned from the switch
3200SwitchFailure to queue transaction at the switch due to downtime or server load on the switch
3210SwitchProvider failure to authenticate at the switch due to server load on the switch
3300SwitchCustomer information mismatch at the switch
4100CustomerCustomer has insufficient / low balance, or account limit(s) have been reached
4200CustomerCustomer failed to 1. Respond to the prompt on time or 2. Enter the correct pin
5100MerchantCustomer is either not registered for this service, invalid network, account is ported, inactive or dormant
5200MerchantInvalid account number
5210MerchantInvalid amount
6100ProviderTransaction is found to be a duplicate at the provider / switch. Wait a few minutes and retry.
6200SwitchThe transaction failed processing at the switch - Backend Error
6300ProviderEmail field must contain a valid email
6400ProviderThe provider's balance with the switch is low / insufficient to perform the transaction
6500ProviderFailure to queue transaction at the provider due to downtime or server load on the provider
7100OGatewayTransaction Processing Failed at OGateway

Faults

There are 5 Fault types maintained by Open Gateway

Fault NameReason / Description
CustomerCustomer fault stems from situations where the final outcome of a transaction is customer dependent e.g. when a customer fails to enter their pin to approve a transaction, or when a customers daily limit on their account is exceeded.
MerchantMerchant faults are due to incorrect information passed to OGateway such as a provided phone number with an incorrect network, or an incorrect phone number.
OGatewayOGateway faults relate to internal issues that may occur at OGateways side which may include brief service disruptions causing transaction failures.
ProviderWe work with partners in processing our transactions. These partners may have brief service disruptions causing some transactions to fail.
SwitchThese emanate from the Telco, Bank or the national switch (GHIPSS) depending on where a provider routes the transaction through. This is the final error fault level.

Sample Callback Payloads

{
  "id": "579eea58-49be-485c-59de-d9881d24c4gd",
  "fee": 10,
  "type": "CREDIT",
  "amount": 133,
  "reason": "CREDIT_MOMO",
  "status": "COMPLETED",
  "channel": "MOMO",
  "network": "MTN",
  "bear_fee": "business",
  "currency": "GHS",
  "customer": {
    "accountName": "Bernard Danso",
    "accountNumber": "0249123456"
  },
  "metadata": {
    "transactionAmount": 133, //for payouts
    "smsFee": 0 //for collections
  },
  "created_at": "2023-07-06T13:35:41.308Z",
  "updated_at": "2023-07-06T13:35:41.308Z",
  "checkout_url": null,
  "message": "0000 | Switch | Approved",
  "telco_response": "APPROVED",
  "virtual_account": null,
  "provider_message": "Success",
  "reference_business": "d20d4d8df51712345432"
}
//The customer failed to respond to the Mobile Money prompt, or did not go to their approvals screen to approve the transaction.

{
  "id": "5ba941b5-eb5c-4618-b8ec-4d1419fb2d38",
  "fee": "0",
  "type": "DEBIT",
  "amount": "22",
  "reason": "Payment for services",
  "status": "FAILED",
  "channel": "MOMO",
  "network": "MTN",
  "bear_fee": "business",
  "currency": "GHS",
  "customer": {
    "accountName": "Bernard Danso",
    "accountNumber": "0249123456"
  },
  "metadata": {
    "transactionAmount": 22, //for payouts
    "smsFee": 0 //for collections
  },
  "created_at": "2023-07-06T13:35:41.308Z",
  "updated_at": "2023-07-06T13:40:41.308Z",
  "checkout_url": null,
  "instructions": "If no prompt pops up, pls check your Approval List by dialing *170# and choosing option 6 then option 3.", // for collections
  "message": "4200 | Customer | Customer failed to 1. Respond to the prompt on time or 2. Enter the correct pin",
  "telco_response": "Request timeout",
  "virtual_account": null,
  "provider_message": "Failed",
  "reference_business": "d20d4d8df15712345432"
}
// An invalid account number was used for the transaction i.e. an MTN number was used instead of a valid VOD number.

{
  "id": "5ba941b5-eb5c-4618-b7ce-4d1419fb2d38",
  "fee": 120.52,
  "type": "CREDIT",
  "amount": 6026,
  "reason": "CREDIT_MOMO",
  "status": "FAILED",
  "channel": "MOMO",
  "network": "VOD",
  "bear_fee": "business",
  "currency": "GHS",
  "customer": {
    "accountName": "Bernard Danso",
    "accountNumber": "0249123456"
  },
  "metadata": {
    "transactionAmount": 6026, //for payouts
    "smsFee": 0 //for collections
  },
  "created_at": "2023-07-06T13:35:41.308Z",
  "updated_at": "2023-07-06T13:40:41.308Z",
  "checkout_url": null,
  "message": "5200 | Merchant | Invalid account number",
  "telco_response": "Receiver invalid",
  "virtual_account": null,
  "provider_message": "Failed",
  "reference_business": "d20d4d8df51712345432"
}

Callback Payload Field Definition

ParameterTypeDescription
idStringUnique system identifier for the transaction record.
feeStringThe processing fee charged for the transaction.
typeStringThe direction of the transaction (e.g., DEBIT, CREDIT).
amountStringThe total amount of the transaction.
reasonStringThe description or purpose of the payment.
statusStringCurrent state of the transaction (e.g., FAILED, COMPLETED, PENDING).
channelStringThe payment channel utilized (e.g., MOMO).
networkStringThe specific telecommunications network/provider (e.g., MTN, VOD).
bear_feeStringIndicates who bears the cost of the transaction fee (e.g., business or customer).
currencyStringThe 3-letter ISO currency code (e.g., GHS).
customerObjectAn object containing the customer's account details.
customer.accountNameStringThe registered name of the customer's mobile money account.
customer.accountNumberStringThe mobile number or account identifier of the customer.
metadataObjectA key-value object containing additional context or custom data.
metadata.transactionAmountNumberThe specific transaction amount, typically provided for payouts.
metadata.smsFeeNumberThe SMS fee applied, typically provided for collections.
created_atStringISO 8601 timestamp indicating when the transaction was initiated.
updated_atStringISO 8601 timestamp indicating when the transaction status was last updated.
checkout_urlString/NullA link to the hosted checkout page, if applicable.
instructionsStringHelpful instructions (like USSD codes) to display to the user if the automatic push prompt fails.
messageStringA code, fault and message explaining the final status of the transaction (e.g., failure reasons).
telco_responseStringThe raw system response message received directly from the network provider.
virtual_accountString/NullThe virtual account number, if a bank transfer method was used.
provider_messageStringA simplified status message directly from the payment provider.
reference_businessStringThe unique internal reference generated by your business system for tracking.