Bank Transfers
This API will allow you to accept bank transfer payments through your custom checkout process. In other words, it allows customers to send money from their bank accounts to yours instantly via NIP (NIBSS Instant Payment) transfer.
Note: When testing this endpoint, we will provide a mocked response meaning that you’ll get a successful response no matter what. So please note that this is only for testing purposes and will be different during production.
Step 1: Initialize a bank transfer transaction
Here you can commence a bank transfer transaction by making a POST
request to the /transaction/bankTransfer/initialize
endpoint.
HTTP Method
POST
Header Parameters
Parameter | Description |
---|---|
Content-type | application/JSON |
MerchantId | OPay merchant ID is a unique 15-digit number assigned to all OPay merchants. To get your merchantID, login to your OPay Dashboard and click on Settings. |
Authorization | Bearer + Signature (Signature is a combination of both the payload and your secret/private key) |
API Endpoint
/transaction/bankTransfer/initialize
Sample Request
curl -X POST --header 'Authorization: Bearer Signature' --header 'MerchantId:
256619092316009' --header 'content-type: application/json'
https://cashierapi.opayweb.com/api/v3/transaction/bankTransfer/initialize
Sample Request Body
{
"reference": "test_20210302114235",
"productDesc": "The best wireless earphone in history",
"userPhone": "+2349876543210",
"userRequestIp": "123.123.123.123",
"amount": "100",
"currency": "NGN",
"callbackUrl": "https://you.domain.com/callbackUrl",
"expireAt": "10"
}
Sample response
{
"code": "00000",
"message": "SUCCESSFUL",
"data": {
"orderNo": "210323140538859499",
"reference": "test_20210302114235",
"status": "SUCCESS",
"amount": "100",
"currency": "NGN",
"transferBank": "TEST",
"transferAccount": "888888888"
}
}
PROPERTY | DESCRIPTION |
---|---|
reference | Order number of merchant (unique order number from merchant platform) |
orderNo | Order number from OPay payment |
amount | Amount in kobo |
currency | Currency charge should be performed in. Default is NGN |
status | INITIAL PENDING SUCCESS FAIL CLOSE |
transferBank | WEMA Bank |
transferAccount | 778 2811 9802 |
Step 2: Get status of bank transfer transaction
When you’ve initialized a transaction, you should wait 10 seconds or more, then proceed to check the status of the transaction. Keep requerying to get the final status of your transaction, which is either “FAILED” or “SUCCESSFUL”.
Please note that the Authorization header consists of “Bearer Signature” which is essentially a HMAC SHA512 signature of the whole payload signed using your Secret Key. The payload should be in alphabetical order. You can use our Signature calculator here.
HTTP Method
POST
Header Parameters
Parameter | Description |
---|---|
Content-type | application/JSON |
MerchantId | OPay merchant ID is a unique 15-digit number assigned to all OPay merchants. To get your merchantID, login to your OPay Dashboard and click on Settings. |
Authorization | Bearer + Signature (Signature is a combination of both the payload and your secret/private key) |
API Endpoint
/transaction/bankTransfer/status
Sample Request
curl -X POST --header 'Authorization: Bearer Signature' --header 'MerchantId:
256619092316009' --header 'content-type: application/json'
https://cashierapi.opayweb.com/api/transaction/bankTransfer/status
Sample Request Body
{
"orderNo": "210323140538859499",
"reference": "test_20210302114235"
}
Sample Response
{
"code": "00000",
"message": "SUCCESSFUL",
"data": {
"orderNo": "210323140538859499",
"reference": "test_20210302114235",
"status": "PENDING",
"amount": "100",
"currency": "NGN",
"supportRefundOriginal": null
}
}
PROPERTY | DESCRIPTION |
---|---|
orderNo | Order number of OPay payment |
reference | Order number of merchant (unique order number from merchant platform) |