Betting Topup
OPay allows merchants to topup their customers' betting balance via API.
Basic flow:
- Call /api/v3/bills/betting-providers to get all the avaliable betting service providers.
- Call /api/v3/bills/validate to validate the beneficiary account(customerId) with a specific betting provider.
- Call /api/v3/bills/bulk-bills to initialize topup transactions. batch topup is also supported.
- Call /api/v3/bills/status to inquire the latest or final transaction status.
/bills/betting-providers
HTTP Method
POST
API Endpoint
/bills/betting-providers
Sample Request
curl -X POST --header 'Authorization: Bearer PUBLIC_KEY' --header 'MerchantId:
256619092316009' --header 'content-type: application/json'
https://cashierapi.opayweb.com/api/v3/bills/betting-providers
Sample Response
[
{
"provider": "NAIRABET",
"providerLogoUrl": "https://owallet-prod-public.oss-eu-west-1.aliyuncs.com/images/api/icon/betting/nairabet.png"
},
{
"provider": "BET9JA",
"providerLogoUrl": "https://owallet-prod-public.oss-eu-west-1.aliyuncs.com/images/api/icon/betting/Bet9ja.png"
}
]
RESPONSE PROPERTY | DESCRIPTION |
---|---|
provider | OBetting topup service provider |
providerLogoUrl | Provider logo URL |
/bills/validate
Validate the customerId for a specific provider.
HTTP Method
POST
API Endpoint
/bills/validate
Sample Request
curl -X POST --header 'Authorization: Bearer PUBLIC_KEY' --header 'MerchantId:
256619092316009' --header 'content-type: application/json'
https://cashierapi.opayweb.com/api/v3/bills/validate
Sample Request Body
{
"serviceType": "betting",
"provider": "NAIRABET",
"customerId": "20019212912901281821982"
}
REQUEST PROPERTY | DESCRIPTION |
---|---|
serviceType | betting |
provider | provider returned in betting-providers |
customerId | beneficiary's customerId for the specific provider |
Sample Response
{
"provider": "NAIRABET",
"customerId": "20019212912901281821982",
"firstName": "xxx",
"lastName": "xxx",
"userName": "xxx"
}
RESPONSE PROPERTY | DESCRIPTION |
---|---|
provider | provider |
customerId | beneficiary's customerId for the specific provider |
firstName | returned by provider |
lastName | returned by provider |
userName | returned by provider |
/bills/bulk-bills
Initialize a betting topup transaction
Valid was raised with an header Authorization: Bear Signature
which is essentially a HMAC SHA512 signature of the whole payload signed using your Secret Key , and payload should be ordered by keys in alphabetical order.
HTTP Method
POST
API Endpoint
/bills/bulk-bills
Sample Request
curl -X POST --header 'Authorization: Bearer Signature' --header 'MerchantId:
256619092316009' --header 'content-type: application/json'
https://cashierapi.opayweb.com/api/v3/bills/bulk-bills
Sample Request Body
{
"bulkData": [
{
"amount": "1000100",
"country": "NG",
"currency": "NGN",
"customerId": "014562021",
"provider": "NAIRABET",
"reference": "123333330001"
},
{
"amount": "10200",
"country": "NG",
"currency": "NGN",
"customerId": "014562021",
"provider": "NAIRABET",
"reference": "123333330002"
}
],
"callBackUrl": "xxxxxx",
"serviceType": "betting"
}
REQUEST PROPERTY | DESCRIPTION |
---|---|
callBackUrl | Callback Url for successful transaction notification |
serviceType | Default is betting |
country | Default is NG |
currency | Default is NGN |
amount | Amount in kobo |
customerId | beneficiary's customerId for the specific provider |
provider | provider returned in betting-providers |
reference | Order number of merchant (unique order number from merchant platform) |
Sample Response
[
{
"orderNo": "20019212912901281821981",
"reference": "test_20191123132232",
"status": "SUCCESS",
"errorMsg": ""
},
{
"orderNo": "20019212912901281821982",
"reference": "test_20191123132233",
"status": "FAIL",
"errorMsg": "fail reasons"
}
]
RESPONSE PROPERTY | DESCRIPTION |
---|---|
orderNo | Order number of OPay payment |
reference | Merchant reference (unique order number from merchant platform) |
status | INITIAL PENDING SUCCESS FAIL |
errorMsg | Will return why error happened |
/bills/bulk-status
Initialize a betting topup transaction status inquiry
Valid was raised with an header Authorization: Bear Signature
which is essentially a HMAC SHA512 signature of the whole payload signed using your Secret Key , and payload should be ordered by keys in alphabetical order.
HTTP Method
POST
API Endpoint
/bills/bulk-status
Sample Request
curl -X POST --header 'Authorization: Bearer PUBLIC_KEY' --header 'MerchantId:
256619092316009' --header 'content-type: application/json'
https://cashierapi.opayweb.com/api/v3/bills/bulk-status
Sample Request Body
{
"bulkStatusRequest": [
{
"orderNo": "20019212912901281821982",
"reference": "test_20191123132233"
},
{
"orderNo": "20019212912901281821983",
"reference": "test_20191123132234"
},
{
"orderNo": "20019212912901281821984",
"reference": "test_20191123132235"
}
],
"serviceType": "betting"
}
REQUEST PROPERTY | DESCRIPTION |
---|---|
serviceType | Default is betting |
orderNo | Order number of OPay payment (Optional) |
reference | Merchant reference (unique order number from merchant platform) |
Sample Response
[
{
"orderNo": "20019212912901281821982",
"reference": "test_20191123132233",
"status": "SUCCESS",
"errorMsg": ""
},
{
"orderNo": "20019212912901281821983",
"reference": "test_20191123132234",
"status": "FAIL",
"errorMsg": "error"
},
{
"orderNo": "20019212912901281821983",
"reference": "test_20191123132234",
"status": null,
"errorMsg": "order does not exist!"
}
]
RESPONSE PROPERTY | DESCRIPTION |
---|---|
orderNo | Order number of OPay payment |
reference | Merchant reference (unique order number from merchant platform) |
status | INITIAL PENDING SUCCESS FAIL |
errorMsg | error message |