Airtime :: API

Airtime

Parameters:

Parameter_Name Type Description
username String Your MobileNig username
api_key String The api_key generated on MobileNig
network String MTN, 9MOBILE, GLO or AIRTEL (UPPERCASE)
phoneNumber Number The beneficiary (080*** format)
amount Number airtime amount (50 - 50000)
trans_id Number Unique transaction id e.g 12823327903

Command:

https://mobilenig.com/API/airtime?username=****&api_key=****&network=****&phoneNumber=****&amount=****&trans_id=****
//Replace **** with your username, api_key...

For Api test use https://mobilenig.com/API/airtime_test?username=****&api_key=****&network=****&phoneNumber=****&amount=****&trans_id=****
Api Example: https://mobilenig.com/API/airtime?username=PAUL&api_key=64125agshaii168sdhd4b6bdb5&network=MTN&phoneNumber=08011223344&amount=200&trans_id=12823327903
//where username is PAUL and api_key is 64125agshaii168sdhd4b6bdb5, network is MTN, beneficiary is 08011223344, amount is 200 and trans_id is 12823327903.

Response:
If successful: A response will be desplayed in JSON format e.g {"trans_id":"12823327903","details":{"network":"MTN","phone_number":"08011223344","amount":"200","status":"SUCCESSFUL","balance":"3000"}}
Else, one of the responses below will be displayed in this format {"code": "ERR101", "description": "Invalid username or api_key"}

Responses:

Code Description
ERR101 Invalid username or api_key
ERR102 Api service is currently unavailable
ERR103 Requested service is currently unavailable
ERR104 User Suspended
ERR105 Transaction id already exist, kindly generate a unique id
ERR106 Insufficient Balance
ERR107 Transaction Unsuccessful
ERR201 Amount is less than 50 or greater than 50,000
ERR202 Incomplete Parameters

Query:

https://mobilenig.com/API/airtime_query?username=****&api_key=****&trans_id=****
//Replace **** with your username, api_key...
Api Example: https://mobilenig.com/API/airtime_query?username=PAUL&api_key=64125agshaii168sdhd4b6bdb5trans_id=12823327903
//where username is PAUL and api_key is 64125agshaii168sdhd4b6bdb5, trans_id is 12823327903.

Response:
If successful: A response will be desplayed in JSON format e.g {"trans_id":"12823327903","details":{"network":"MTN","phone_number":"08011223344","amount":"50","200":"SUCCESSFUL"}}
Else, response will be displayed in this format {"code": "ERR204", "description": "Could't find transaction on MobileNig"}