Airtime PIN API
Version 2
Supports only (MTN,AIRTEL,9MOBILE AND GLO) Networks in Nigeria
This API allows you to generate airtime PIN directly from your wallet account.
You are required to enable Airtime/Data Api Token in
settings page, save and then copy Api token generated.
Note: Do not share your Api Token
Use sha512 encryption algorithm to generate a hash from combining your Airtime Api Token, Account Email Address, Account Username and Your Transaction Reference.
$hash=hash('sha512', $token.$email.$username.$ref );
Note: The above example shows how to generate the hash in PHP, the dots are not part of the string but for concatenation
$Token is your Api Token
$Ref is an alphanumeric code generated by you for record purposes
To check account balance:
https://www.estoresms.com/smsapi.php?username=user123&password=pass123&balance=true&
where Account Username is user123 and account password is pass123
Note: Your username and password must be url encoded
RESPONSE CODES
OK => Successful
FAIL => Not Successful
P000 => Incomplete Information
P001 => Authentication failed
P002 => Invalid Network selected
P003 => Phone number is required
P004 => Amount is required
P005 => Amount is not numeric
P006 => Minimum recharge allowed per transaction N1
P007 => Invalid phone number
P008 => Network selected for phone number is invalid
P009 => Insufficient Balance
P010 => API Token not enabled
P011 => Process Failed
P012 => Unable to complete request
P013 => Maximum recharge allowed per transaction N300,000.
P014 => Maximum number of pins that can be generated at once is 1000.
GET SUPPORTED NETWORKS
Url:
https://estoresms.com/network_list
Method: GET
Parameters: None
SAMPLE RESPONSE
[
{"id":"airtel","name":"Airtel Network"},
{"id":"9mobile","name":"9mobile Network"},
{"id":"mtn","name":"MTN Network"},
{"id":"glo","name":"Glo Network"}
]
GENERATE AIRTIME PIN
Url: https://estoresms.com/network_processing/v/2
Method: POST
Request Format: JSON
Response Format: JSON
Specifying the network of the phone number is optional
SAMPLE REQUEST
Minimum Amount: 50
Maximum Amount: 300000
Note: Message limit is 20 characters
Count is the number of pins to generate (Optional, default is 1)
{
"username":"user123",
"ref":"MyRef001",
"hash":"g521f5ba60d1fd56c0ee067bc838d4c6c502b7921ae530c4d2",
"callback":"https://mywebsite/callback",
"pinAmount":"50",
"count":"2",
"pinMessage":"Thank you for using our service",
}
SAMPLE RESPONSE 1
{
"response":"OK",
"ref":"myRef",
"transaction_id":"api_5d2597bc3c287",
"serial":"375919",
"pin":"7069933456200",
"USSD":"*258*7069933456200#",
"amount":50,
"amount_charged":49
}
{
"response":"OK",
"ref":"myRef",
"transaction_id":"api_5d8cc87e9a396",
"amount":2,
"amount_charged":"1.96",
"data":[
{
"serial":"3331167",
"pin":"7018277106518",
"USSD":"*258*7018277106518#"
},
{
"serial":"3331168",
"pin":"3711210133031",
"USSD":"*258*3711210133031#"
}
]
}
SAMPLE RESPONSE 3
{
"response":"P009",
"message":"Insufficient Balance"
}