OPay

Collect Payments from OPay e-wallets.

Opay is a Nigerian digital wallet preferred by several customers to make transactions.

Flutterwave allows you to collect payment from your customers by debiting their OPay wallets directly. This transaction involves redirecting to the customer's wallet to authorize the debit and complete the payment.

📘

Regional availability

This payment method is only available for NGN transactions.

You must complete your KYC before adding this payment method to your account. To add OPay to your preferred payment methods, follow the steps in this video:


Understanding the Payment process

OPay payments are redirect-based. These transactions require redirecting your customers to their wallets where OPay handles authorization and security checks.

There are three key steps in making OPay payments:

  1. Transaction initiation: In this stage, you initiate the payment using the customer's information.
  2. Authorization: Following a successful initiation, Flutterwave redirects your customer to OPay to authorize the payment.
  3. Transaction Verification: Querying the final status of the payment.

Transaction Initiation

To initiate an OPay payment, first collect the customer's email, phone number and full name.

Send the customer's information and transaction details (amount, currency and transaction reference) in your request to the charge endpoint.

{
   "tx_ref":"1094170974664243543155",
   "amount":"600",
   "currency":"NGN",
   "email":"[email protected]",
   "fullname":"Example User",
   "phone_number":"2348130001111",
   "redirect_url":"https://fast.com"
}

On making a successful request, we return a 200 response with pending status and other transaction details.

{
   "status":"success",
   "message":"Charge initiated",
   "data":{
      "id":674651936,
      "tx_ref":"QA37188995",
      "flw_ref":"GDPS1094170974664243543155",
      "device_fingerprint":"N/A",
      "amount":600,
      "charged_amount":600,
      "app_fee":0.84,
      "merchant_fee":0,
      "processor_response":"transaction is pending",
      "auth_model":"OPAY",
      "currency":"NGN",
      "ip":"52.31.208.245",
      "narration":"OPay Transaction FOR Developers Demo",
      "status":"pending",
      "auth_url":"https://sandboxcashier.opaycheckout.com/apiCashier/redirect/payment/cashier-list?orderToken=TOKEN.8825436f5b5c49ef8cadf1b53b2d0360",
      "payment_type":"opay",
      "fraud_status":"ok",
      "charge_type":"normal",
      "created_at":"2024-03-06T17:37:21.000Z",
      "account_id":1090303,
      "customer":{
         "id":585127860,
         "phone_number":"2348130001111",
         "name":"Example User",
         "email":"[email protected]",
         "created_at":"2024-03-06T17:19:51.000Z"
      },
      "meta":{
         "authorization":{
            "mode":"redirect",
            "redirect":"https://sandboxcashier.opaycheckout.com/apiCashier/redirect/payment/cashier-list?orderToken=TOKEN.8825436f5b5c49ef8cadf1b53b2d0360"
         }
      }
   }
}
{
   "status": "error",
   "message": "Merchant is not enabled to accept opay transactions.",
   "data": null
}

Authorization

The payment initiation response contains the redirect link returned as data.meta.authorization.redirect. Redirect your users to this link to complete the payment.

Customers are first expected to log into their OPay accounts before selecting their preferred balance to complete the transaction.

Transaction Verification

Once the transaction is authorized, you need to verify the final transaction status. There are two options to do this:

  • Querying the transaction status endpoint using the transaction id.
  • Inspecting the webhook returned for the transaction.

Irrespective of what method you choose to verify the transaction, It is important to check the amount, transaction reference and status before providing value.

{
  "event": "charge.completed",
  "data": {
    "id": 1341889059,
    "tx_ref": "QA81347552",
    "flw_ref": "QXAG0632171276387946131800",
    "device_fingerprint": "N/A",
    "amount": 60,
    "currency": "NGN",
    "charged_amount": 60.84,
    "app_fee": 0.84,
    "merchant_fee": 0,
    "processor_response": "Approved Or Completed Successfully",
    "auth_model": "OPAY",
    "ip": "54.154.184.168",
    "narration": "OPay Transaction FOR Olaobaju Abraham ",
    "status": "successful",
    "payment_type": "opay",
    "created_at": "2024-04-10T15:44:38.000Z",
    "account_id": 47337,
    "customer": {
      "id": 841951409,
      "name": "Abraham Olaobaju",
      "phone_number": "2349060000001",
      "email": "[email protected]",
      "created_at": "2024-04-10T14:04:42.000Z"
    }
  },
  "event.type": "OPAY_TRANSACTION"
}