Step 1. GET AIRTIME PRODUCT LIST
Url: https://estoresms.com/network_list/v/2
Method: POST
Request Format: JSON
Response Format: JSON
SAMPLE REQUEST
{
"username":"user123",
"hash":"6a7ba624db21e84c6cb58e9e7f0055c8316bc2c2e3ac1d35e8c3fe",
"phone":"+1410xxxxxxxx",
"country":"US"
}
SAMPLE RESPONSE 1
{
"response":"OK",
"info":{
"openRange":true,
"country":"United States",
"operator":"MTS",
"msisdn":"1410xxxxxxx"
},
"products":[
{
"id":"US-50-OR",
"min":20,
"max":1500,
"topup_currency":"USD",
"rate":100
}
]
}
Open Range: Indicates the available product list has no fixed amount and price, hence you can supply any amount within the minimum and maximum limit
ID: This is the product ID
Topup Currency: The currency used by the phone network
Rate: How much we charge your account in Naira.
Hence,
1. You can request for a purchase between 20 USD to 1500 USD. Note: Avoid decimal points, 20.6 USD is rounded up to 21 USD
2. If you request for a purchase of 20 USD for example. Price= Amount*rate (Price=20*100)
3. Price is how much it costs in Naira. (Rounded up to 2 decimal places)
SAMPLE RESPONSE 2
{
"response":"OK",
"info":{
"openRange":false,
"country":"United Kingdom",
"operator":"Everything Everywhere EE",
"msisdn":"4477xxxxxxxx"
},
"products":[
{
"id":"UKBL-1755-5.00",
"topup_currency":"GBP",
"topup_amount":"5.00",
"price":1610.4
},
{
"id":"UKBL-1755-10.00",
"topup_currency":"GBP",
"topup_amount":"10.00",
"price":3217.5
},
{
"id":"UKBL-1755-15.00",
"topup_currency":"GBP",
"topup_amount":"15.00",
"price":4827.9
}
]
}
Open Range: Indicates the product list has fixed amount and price
ID: This is the product ID
Topup Currency: The currency used by the phone network
Topup Amount: The amount of airtime that would be credited to line
Price: Price is how much it costs in Naira. (Rounded up to 2 decimal places)
Step 2. MAKE AIRTIME PURCHASE
Url: https://estoresms.com/network_processing/v/2
Method: POST
Request Format: JSON
Response Format: JSON
Note: Product ID must be gotten from step 1 for every purchase
SAMPLE REQUEST
{
"username":"user123",
"ref":"myRef",
"hash":"6a7ba624db21e84c6cb58e9e7f0055c8316bc2c2e3ac1d35e8c3fe",
"callback":"https://mywebsite/callback",
"request":[
{
"product":"US-50-OR",
"phone":"+1410xxxxxxx",
"amount":20,
"country":"UK"
},
{
"product":"UKBL-1755-5.00",
"phone":"+4477xxxxxxxx",
"country":"UK"
}
]
}
SAMPLE RESPONSE 1
{
"failed":0,
"result":[
{
"response":"OK",
"ref":"myRef",
"transaction_id":"api_5ab5261b9b029",
"phone":"+1410xxxxxxx",
"amount":"8389.26",
"amount_charged":"8053.69",
"pins":[
{
"serialNumber":"WRN192775404",
"pin":"740525808961",
"expiresOn":"30 days"
}
]
},
{
"response":"OK",
"ref":"myRef",
"transaction_id":"api_5ab5223b8b927",
"phone":"+4477xxxxxxxx",
"amount":"1610.4",
"amount_charged":"1546",
"pins":[]
}
]
}
SAMPLE RESPONSE 2
{
"failed":0,
"result":[
{
"response":"PENDING",
"ref":"myRef",
"transaction_id":"api_5ab5261b9b029",
"phone":"+1410xxxxxxx",
"amount":"8389.26",
"amount_charged":"8053.69"
},
{
"response":"PENDING",
"ref":"myRef",
"transaction_id":"api_5ab5223b8b927",
"phone":"+4477xxxxxxxx",
"amount":"1610.4",
"amount_charged":"1546"
}
]
}
PENDING response means you will need to Query the transaction
later on for final status
SAMPLE RESPONSE 3
{
"response":"P013",
"message":"Insufficient Balance"
}
SAMPLE RESPONSE 4
{
"failed":2,
"result":[
{
"response":"P008",
"message":"Invalid Amount",
"phone":"+1410xxxxxxx"
},
{
"response":"P006",
"message":"Product ID is required",
"phone":"+4477xxxxxxxx"
}
]
}