JOLO CLOUD API

Introduction

This api documentation is applicable for following services only:
   1. Mobile recharge (prepaid & postpaid)
   2. DTH recharge
   3. Datacard recharge (prepaid & postpaid)
   4. Landline & broadband bill payment
For other services, please follow respective api documentation page.

Money transfer API Documentation available on this page.

Get API key

We assume you have created free account on joloapi.com, if not then please Create Account now. It will take hardly 1 minute. Now to get your api key, do this:
Login -> click on Account Manage -> click on API Key
On right side, you can see your live api key. If you want to change this api key in future then you have to click on "Generate Now" button on left side.

Secure your api account

To secure your api account, you need to white list your server ip in joloapi dashboard. We will accept the incoming request from your server only. If you are using multiple servers then you need to white list all server ip. Maximum 4 different server allowed per joloapi account. To white list your server ip, do this:
Login -> click on Account Manage -> click on API Server IP
On right side, you can see your live server ip. To add/update server ip, enter ip address on left side. You can see 4 input boxes for 4 server ip. If you want to use api only on 1 server then enter only 1 ip in any input box and click on "Save Now" button. Refresh the page to view the updates.

Sandbox for testing all api without balance

During integration of api, you don't have to add balance in joloapi account. You will get success response but actual recharge will not done. To use sandbox, do this:
Pass value of "mode" parameter as 0.
0 = sandbox mode
1 = live mode

Balance check API

To check your joloapi balance, setup this:
JSON REQUEST
https://joloapi.com/api/balance.php?userid=xx&key=xx&type=json
    
Parameters:
userid = your joloapi account userid
key = your joloapi account key
type= json OR text
JSON RESPONSE
If request not accepted:

{
status: "FAILED",
error: "1"
}

If request accepted:

{
status: "SUCCESS",
error: "0",
balance: "774953.00",
totalearn: "9840.00",
time: "March 02 2018 05:50:12 PM"
}

Impotant note: 
1. If request is not accepted, status will always FAILED and error will give some randowm error codes like 1,2,3,...
2. If request is accepted, status will always SUCCESS along with other account detail.
3. "totalearn" is your outstanding profit.
php api {{ php sample code }}

$userid = "";
$key = "";

$curl_error="";
$ch = curl_init();
$timeout = 131; // max. wait time in seconds
$myurl = "https://joloapi.com/api/balance.php?userid=$userid&key=$key&type=json";
curl_setopt ($ch, CURLOPT_URL, $myurl);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
$curl_error = curl_errno($ch);
curl_close($ch);

if($curl_error)
{
$log_message="Unable to capture api response-$file_contents";
}else{
$jsondata = json_decode($file_contents, true);
$countxx = count($jsondata);
if($countxx > 2)
{
$log_message="API Request accepted-$file_contents";
$status = $jsondata['status'];
$error = $jsondata['error'];
$balance = $jsondata['balance'];
$totalearn = $jsondata['totalearn'];
$time = $jsondata['time'];
}else{
$log_message="API Request not accepted-$file_contents";
$status = $jsondata['status'];
$error = $jsondata['error'];
}
}

//make final calls based on status here
if(empty($status)){
    //consider as pending
}
if($status=='SUCCESS'){
     //consider as success
}
if($status=='FAILED'){
     //consider as failed
}

//store in logs
//$log_message
    
android api {{ android sample code }}

public class MainActivity extends AppCompatActivity {
   final static String baseurl="https://joloapi.com/api/";
    final static String userid="youruserid";// do not use directly, use firebase for security
    final static String key="yourkey";// do not use directly, use firebase for security
   
   @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        runapi();
        }
        
        public void runapi(){
        String myurl = baseurl + "balance.php?userid="+userid+"&key="+key+
                "&type=json";
        new Check_runapi().execute(myurl);
        }
         class Check_runapi extends AsyncTask <String,Void, String> {
        @Override
        protected void onPreExecute() {
            super.onPreExecute();
        }
        @Override
        protected String doInBackground(String... params) {
            URL url = null;
            try {
                //As we are passing just one parameter to AsyncTask, so used param[0] to get value at 0th position that is URL
                url = new URL(params[0]);
            } catch (MalformedURLException e) {
                e.printStackTrace();
            }
            try {
                HttpURLConnection urlConnection = null;
                if (url != null) {
                    urlConnection = (HttpURLConnection) url.openConnection();
                }
                //Getting inputstream from connection, that is response which we got from server
                InputStream inputStream = null;
                if (urlConnection != null) {
                    inputStream = urlConnection.getInputStream();
                }
                //Reading the response
                BufferedReader bufferedReader = null;
                if (inputStream != null) {
                    bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
                }
                String s = null;
                if (bufferedReader != null) {
                    s = bufferedReader.readLine();
                }
                if (bufferedReader != null) {
                    bufferedReader.close();
                }
                //Returning the response message to onPostExecute method
                return s;
            } catch (IOException e) {
                Log.e("Error: ", e.getMessage(), e);
            }

            return null;
        }
        @Override
        protected void onPostExecute(String s) {
            super.onPostExecute(s);
            JSONObject jsonObject=null;
            try {
                jsonObject=new JSONObject(s);
                if(jsonObject.length()>2) {
                    String status=jsonObject.getString("status");
                    String error=jsonObject.getString("error");
                    String msg=jsonObject.getString("msg");
                    String balance=jsonObject.getString("balance");
                    String totalearn=jsonObject.getString("totalearn");
                    String time=jsonObject.getString("time");
                    Toast.makeText(MainActivity.this, "API RESPONSE:"+balance, Toast.LENGTH_SHORT).show();
                }else {
                    String status=jsonObject.getString("status");
                    String error=jsonObject.getString("error");
                    Toast.makeText(MainActivity.this, "API RESPONSE:"+status, Toast.LENGTH_SHORT).show();
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
        }
    }

}


Important security tips:
1. We recommend you to store api userid and key in firebase and then call it in code and make it static variable. Do not use directly like in example above.
2. We also recommend you to do not use our api directly in android app. For 100% security, use on your server first then make your own api from your server then use it on android app. Keep your user management system on server instead of inbuild android database like sqllite etc.
3. If you want to use directly, you need to email us your userid for activation of api for android.
    

Mobile recharge API (prepaid type)

To use mobile recharge service, setup this:
JSON REQUEST
https://joloapi.com/api/recharge.php?userid=xx&key=xx&type=json&mode=xx&operator=xx&service=xx&amount=xx&orderid=xx
    
Parameters:
userid = your joloapi account userid
key = your joloapi account key
type = json OR text
mode = Pass 1 for live
mode = Pass 0 for sandox (testing)
service = Pass 10 digit mobile number of customer
amount = Pass amount value to be recharge ranging from 4 to 25000
orderid = Pass unique orderid generated by your script for tracking status later on
operator= Pass operator code like AT for airtel, JO for jio. List given below:
AIRTEL AT
BSNL BS
BSNL SPECIAL BSS
IDEA IDX
JIO JO
VODAFONE VF
TELENOR UN
TELENOR SPECIAL UNS
AIRCEL AL
TATA DOCOMO GSM TD
TATA DOCOMO GSM SPECIAL TDS
TATA INDICOM (CDMA) TI
MTNL DELHI MTD
MTNL DELHI SPECIAL MTDS
MTNL MUMBAI MTM
MTNL MUMBAI SPECIAL MTMS
JSON RESPONSE
If request not accepted:

{
status: "FAILED",
error: "1"
}

If request accepted:

{
status: "SUCCESS",
error: "0",
txid: "Z20180000000000000",
operator: "AT",
service: "9999999999",
amount: "10",
orderid: "1234567890",
operatorid: "0",
balance: "75699.45",
margin: "0.24",
time: "March 01 2018 09:48:09 PM"
}

Impotant note: 
1. If request is not accepted, status will always FAILED and error will give some randowm error codes like 1,2,3,...
2. If request is accepted, status will always SUCCESS along with other account detail.
3. "txid" is unique JOLO order ID.
4. "operatorid" is unique service provider order ID
5. "balance" is your api balance left
6. "margin" is your profit (in Rs.) on transaction
php api {{ php sample code }}

$userid = "";
$key = "";
$orderid = substr(number_format(time() * rand(),0,'',''),0,10); //generating unique order id

$curl_error="";
$ch = curl_init();
$timeout = 131; // max. wait time in seconds
$myurl = "https://joloapi.com/api/recharge.php?userid=$userid&key=$key&type=json&mode=1&operator=AT&service=9999999999&amount=10&orderid=$orderid";
curl_setopt ($ch, CURLOPT_URL, $myurl);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
$curl_error = curl_errno($ch);
curl_close($ch);

if($curl_error)
{
$log_message="Unable to capture api response-$file_contents";
}else{
$jsondata = json_decode($file_contents, true);
$countxx = count($jsondata);
if($countxx > 2)
{
$log_message="API Request accepted-$file_contents";
$status = $jsondata['status'];
$error = $jsondata['error'];
$txid = $jsondata['txid'];
$operator = $jsondata['operator'];
$service = $jsondata['service'];
$amount = $jsondata['amount'];
$orderid = $jsondata['orderid'];
$operatorid = $jsondata['operatorid'];
$balance = $jsondata['balance'];
$margin = $jsondata['margin'];
$time = $jsondata['time'];
}else{
$log_message="API Request not accepted-$file_contents";
$status = $jsondata['status'];
$error = $jsondata['error'];
}
}

//make final calls based on status here
if(empty($status)){
    //consider as pending
}
if($status=='SUCCESS'){
     //consider as success
}
if($status=='FAILED'){
     //consider as failed
}

//store in logs
//$log_message
    

DTH recharge API

To use dth recharge service, setup this:
JSON REQUEST
https://joloapi.com/api/recharge.php?userid=xx&key=xx&type=json&mode=xx&operator=xx&service=xx&amount=xx&orderid=xx
    
Parameters:
userid = your joloapi account userid
key = your joloapi account key
type = json OR text
mode = Pass 1 for live
mode = Pass 0 for sandox (testing)
service = Pass dth ID as given below
amount = Pass amount value to be recharge ranging from 10 to 25000
orderid = Pass unique orderid generated by your script for tracking status later on
operator= Pass operator code like AD for airtel dth. List given below:
VIDEOCON D2H VT pass Customer ID (MIN LENGTH 4, MAX LENGTH 14)
SUN DTH SD pass Smart Card Number (MIN LENGTH 11, MAX LENGTH 11)
RELIANCE BIG TV DTH BT pass Smart Card Number (MIN LENGTH 12, MAX LENGTH 12)
TATA SKY DTH TS pass Subscriber ID or Registered Mobile (MIN LENGTH 10, MAX LENGTH 10)
DISH DTH DT pass Viewing Card Number (MIN LENGTH 11, MAX LENGTH 11)
AIRTEL DTH AD pass Customer ID (MIN LENGTH 10, MAX LENGTH 10)
JSON RESPONSE
If request not accepted:

{
status: "FAILED",
error: "1"
}

If request accepted:

{
status: "SUCCESS",
error: "0",
txid: "Z20180000000000000",
operator: "AD",
service: "3001915457",
amount: "100",
orderid: "1234567890",
operatorid: "0",
balance: "75699.45",
margin: "2.2",
time: "March 01 2018 09:48:09 PM"
}

Impotant note: 
1. If request is not accepted, status will always FAILED and error will give some randowm error codes like 1,2,3,...
2. If request is accepted, status will always SUCCESS along with other account detail.
3. "txid" is unique JOLO order ID.
4. "operatorid" is unique service provider order ID
5. "balance" is your api balance left
6. "margin" is your profit (in Rs.) on transaction
php api {{ php sample code }}

$userid = "";
$key = "";
$orderid = substr(number_format(time() * rand(),0,'',''),0,10); //generating unique order id

$curl_error="";
$ch = curl_init();
$timeout = 131; // max. wait time in seconds
$myurl = "https://joloapi.com/api/recharge.php?userid=$userid&key=$key&type=json&mode=1&operator=AD&service=3001910000&amount=100&orderid=$orderid";
curl_setopt ($ch, CURLOPT_URL, $myurl);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
$curl_error = curl_errno($ch);
curl_close($ch);

if($curl_error)
{
$log_message="Unable to capture api response-$file_contents";
}else{
$jsondata = json_decode($file_contents, true);
$countxx = count($jsondata);
if($countxx > 2)
{
$log_message="API Request accepted-$file_contents";
$status = $jsondata['status'];
$error = $jsondata['error'];
$txid = $jsondata['txid'];
$operator = $jsondata['operator'];
$service = $jsondata['service'];
$amount = $jsondata['amount'];
$orderid = $jsondata['orderid'];
$operatorid = $jsondata['operatorid'];
$balance = $jsondata['balance'];
$margin = $jsondata['margin'];
$time = $jsondata['time'];
}else{
$log_message="API Request not accepted-$file_contents";
$status = $jsondata['status'];
$error = $jsondata['error'];
}
}

//make final calls based on status here
if(empty($status)){
    //consider as pending
}
if($status=='SUCCESS'){
     //consider as success
}
if($status=='FAILED'){
     //consider as failed
}

//store in logs
//$log_message
    

Datacard recharge API (prepaid type)

To use datacard recharge service, setup this:
JSON REQUEST
https://joloapi.com/api/recharge.php?userid=xx&key=xx&type=json&mode=xx&operator=xx&service=xx&amount=xx&orderid=xx
    
Parameters:
userid = your joloapi account userid
key = your joloapi account key
type = json OR text
mode = Pass 1 for live
mode = Pass 0 for sandox (testing)
service = Pass 10 digit mobile number of customer
amount = Pass amount value to be recharge ranging from 10 to 25000
orderid = Pass unique orderid generated by your script for tracking status later on
operator= Pass operator code like ATD for airtel datacard. List given below:
AIRTEL ATD
BSNL BSD
IDEA IDXD
JIO JOD
VODAFONE VFD
TELENOR UND
AIRCEL ALD
MTNL DELHI MTDD
MTNL MUMBAI MTMD
JSON RESPONSE
If request not accepted:

{
status: "FAILED",
error: "1"
}

If request accepted:

{
status: "SUCCESS",
error: "0",
txid: "Z20180000000000000",
operator: "ATD",
service: "9999999999",
amount: "100",
orderid: "1234567890",
operatorid: "0",
balance: "75699.45",
margin: "2.2",
time: "March 01 2018 09:48:09 PM"
}

Impotant note: 
1. If request is not accepted, status will always FAILED and error will give some randowm error codes like 1,2,3,...
2. If request is accepted, status will always SUCCESS along with other account detail.
3. "txid" is unique JOLO order ID.
4. "operatorid" is unique service provider order ID
5. "balance" is your api balance left
6. "margin" is your profit (in Rs.) on transaction
php api {{ php sample code }}

$userid = "";
$key = "";
$orderid = substr(number_format(time() * rand(),0,'',''),0,10); //generating unique order id

$curl_error="";
$ch = curl_init();
$timeout = 131; // max. wait time in seconds
$myurl = "https://joloapi.com/api/recharge.php?userid=$userid&key=$key&type=json&mode=1&operator=ATD&service=9999999999&amount=100&orderid=$orderid";
curl_setopt ($ch, CURLOPT_URL, $myurl);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
$curl_error = curl_errno($ch);
curl_close($ch);

if($curl_error)
{
$log_message="Unable to capture api response-$file_contents";
}else{
$jsondata = json_decode($file_contents, true);
$countxx = count($jsondata);
if($countxx > 2)
{
$log_message="API Request accepted-$file_contents";
$status = $jsondata['status'];
$error = $jsondata['error'];
$txid = $jsondata['txid'];
$operator = $jsondata['operator'];
$service = $jsondata['service'];
$amount = $jsondata['amount'];
$orderid = $jsondata['orderid'];
$operatorid = $jsondata['operatorid'];
$balance = $jsondata['balance'];
$margin = $jsondata['margin'];
$time = $jsondata['time'];
}else{
$log_message="API Request not accepted-$file_contents";
$status = $jsondata['status'];
$error = $jsondata['error'];
}
}

//make final calls based on status here
if(empty($status)){
    //consider as pending
}
if($status=='SUCCESS'){
     //consider as success
}
if($status=='FAILED'){
     //consider as failed
}

//store in logs
//$log_message
    

Mobile postpaid bill payment API

To use mobile postpaid bill payment service, setup this:
JSON REQUEST
https://joloapi.com/api/cbill.php?userid=xx&key=xx&type=json&mode=xx&operator=xx&service=xx&amount=xx&orderid=xx
    
Parameters:
userid = your joloapi account userid
key = your joloapi account key
type = json OR text
mode = Pass 1 for live
mode = Pass 0 for sandox (testing)
service = Pass 10 digit mobile number of customer
amount = Pass amount value to be recharge ranging from 10 to 25000
orderid = Pass unique orderid generated by your script for tracking status later on
operator= Pass operator code like APOS for airtel. List given below:
AIRTEL APOS
BSNL BPOS
IDEA IPOS
VODAFONE VPOS
AIRCEL CPOS
TATA DOCOMO GSM DGPOS
TATA INDICOM (CDMA) DCPOS
JSON RESPONSE
If request not accepted:

{
status: "FAILED",
error: "1"
}

If request accepted:

{
status: "SUCCESS",
error: "0",
txid: "Z20180000000000",
operator: "APOS",
service: "9999999999",
amount: "100",
orderid: "1234567890",
operatorid: "0",
balance: "75699.45",
margin: "0.50",
time: "March 01 2018 10:49:09 PM"
}

Impotant note: 
1. If request is not accepted, status will always FAILED and error will give some randowm error codes like 1,2,3,...
2. If request is accepted, status will always SUCCESS along with other account detail.
3. "txid" is unique JOLO order ID.
4. "operatorid" is unique service provider order ID
5. "balance" is your api balance left
6. "margin" is your profit (in Rs.) on transaction
php api {{ php sample code }}

$userid = "";
$key = "";
$orderid = substr(number_format(time() * rand(),0,'',''),0,10); //generating unique order id

$curl_error="";
$ch = curl_init();
$timeout = 131; // max. wait time in seconds
$myurl = "https://joloapi.com/api/cbill.php?userid=$userid&key=$key&type=json&mode=1&operator=APOS&service=9999999999&amount=100&orderid=$orderid";
curl_setopt ($ch, CURLOPT_URL, $myurl);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
$curl_error = curl_errno($ch);
curl_close($ch);

if($curl_error)
{
$log_message="Unable to capture api response-$file_contents";
}else{
$jsondata = json_decode($file_contents, true);
$countxx = count($jsondata);
if($countxx > 2)
{
$log_message="API Request accepted-$file_contents";
$status = $jsondata['status'];
$error = $jsondata['error'];
$txid = $jsondata['txid'];
$operator = $jsondata['operator'];
$service = $jsondata['service'];
$amount = $jsondata['amount'];
$orderid = $jsondata['orderid'];
$operatorid = $jsondata['operatorid'];
$balance = $jsondata['balance'];
$margin = $jsondata['margin'];
$time = $jsondata['time'];
}else{
$log_message="API Request not accepted-$file_contents";
$status = $jsondata['status'];
$error = $jsondata['error'];
}
}

//make final calls based on status here
if(empty($status)){
    //consider as pending
}
if($status=='SUCCESS'){
     //consider as success
}
if($status=='FAILED'){
     //consider as failed
}

//store in logs
//$log_message
    

Landline & broadband bill payment API

To use Landline & broadband bill payment service, setup this:
JSON REQUEST
https://joloapi.com/api/cbill.php?userid=xx&key=xx&type=json&mode=xx&operator=xx&service=xx&amount=xx&orderid=xx&std=xx&ca=xx&other=xx
    
Parameters:
userid = your joloapi account userid
key = your joloapi account key
type = json OR text
mode = Pass 1 for live
mode = Pass 0 for sandox (testing)
service = Pass landline number (without std code)(see detail below)
amount = Pass amount value to be recharge ranging from 10 to 25000
orderid = Pass unique orderid generated by your script for tracking status later on
std = Pass std code like 011 for delhi
ca = Pass customer account number (see detail below)
other = Pass 1 only if its corporate connection (applicable for bsnl only)
operator= Pass operator code like ATL for airtel. List given below:
AIRTEL ATL pass Landline Number in "service"
(MIN LENGTH 5, MAX LENGTH 8)
pass std code in "std" No need to pass anything in "ca"
BSNL BSL pass Landline Number in "service"
(MIN LENGTH 5, MAX LENGTH 8)
pass std code in "std" pass Account Number in "ca" & also pass 1 in "other" if corporate connection
RELIANCE RCOM pass Landline Number in "service"
(MIN LENGTH 5, MAX LENGTH 8)
pass std code in "std" No need to pass anything in "ca"
TATA DOCOMO TIL pass Landline Number in "service"
(MIN LENGTH 5, MAX LENGTH 8)
pass std code in "std" No need to pass anything in "ca"
MTNL DELHI MTDL pass Landline Number in "service"
(MIN LENGTH 8, MAX LENGTH 8)
pass std code in "std" pass CA Number in "ca"
MTNL MUMBAI MTML pass Landline Number in "service"
(MIN LENGTH 8, MAX LENGTH 8)
pass std code in "std" pass Account Number in "ca"
TIKONA INTERNET TIK pass Service ID in "service"
(MIN LENGTH 10, MAX LENGTH 10)
No need to pass anything in "std" No need to pass anything in "ca"
JSON RESPONSE
If request not accepted:

{
status: "FAILED",
error: "1"
}

If request accepted:

{
status: "SUCCESS",
error: "0",
txid: "Z2018000000000000",
operator: "ATL",
service: "23545555",
amount: "100",
orderid: "1234567890",
operatorid: "0",
balance: "75699.45",
margin: "0.50",
time: "March 03 2018 11:22:49 PM"
}

Impotant note: 
1. If request is not accepted, status will always FAILED and error will give some randowm error codes like 1,2,3,...
2. If request is accepted, status will always SUCCESS along with other account detail.
3. "txid" is unique JOLO order ID.
4. "operatorid" is unique service provider order ID
5. "balance" is your api balance left
6. "margin" is your profit (in Rs.) on transaction
php api {{ php sample code }}

$userid = "";
$key = "";
$orderid = substr(number_format(time() * rand(),0,'',''),0,10); //generating unique order id

$curl_error="";
$ch = curl_init();
$timeout = 131; // max. wait time in seconds
$myurl = "https://joloapi.com/api/cbill.php?userid=$userid&key=$key&type=json&mode=1&operator=ATL&service=23545555&amount=100&orderid=$orderid&std=011&ca=5555555&other=0";
curl_setopt ($ch, CURLOPT_URL, $myurl);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
$curl_error = curl_errno($ch);
curl_close($ch);

if($curl_error)
{
$log_message="Unable to capture api response-$file_contents";
}else{
$jsondata = json_decode($file_contents, true);
$countxx = count($jsondata);
if($countxx > 2)
{
$log_message="API Request accepted-$file_contents";
$status = $jsondata['status'];
$error = $jsondata['error'];
$txid = $jsondata['txid'];
$operator = $jsondata['operator'];
$service = $jsondata['service'];
$amount = $jsondata['amount'];
$orderid = $jsondata['orderid'];
$operatorid = $jsondata['operatorid'];
$balance = $jsondata['balance'];
$margin = $jsondata['margin'];
$time = $jsondata['time'];
}else{
$log_message="API Request not accepted-$file_contents";
$status = $jsondata['status'];
$error = $jsondata['error'];
}
}

//make final calls based on status here
if(empty($status)){
    //consider as pending
}
if($status=='SUCCESS'){
     //consider as success
}
if($status=='FAILED'){
     //consider as failed
}

//store in logs
//$log_message
    

Get status updates

When you run api, you will get transaction status SUCCESS or FAILED in realtime. But in some rare cases, service provider might change status from SUCCESS to FAILED, then to get update on your server about this change, this feature comes handy. To setup synchronization, do this:
Login -> click on Account Manage -> click on API Synchronize
On right side, you can see your live server url. To add/update server url, enter your server url in input box given on left side and click on "Set it!" button. You need to do some coding on that server url page to capture data automatically. We will send 4 parameters of transaction on your server that you need to capture in following way using POST method:
{{ php sample code }}

$jolostatus = $_POST["status"]; //status of transaction like SUCCESS,FAILED,REPORTED
$operatortxnid = $_POST["operatortxnid"]; //Operator ID
$joloorderid = $_POST["joloorderid"]; //Jolo order ID 
$userorderid = $_POST["userorderid"]; //Your website order ID

if($jolostatus=='SUCCESS'){
//UPDATE DATABASE TABLE BY MATCHING JOLO ORDER ID OR YOUR OWN WEBSITE ORDER ID if its unique
}
if($jolostatus=='FAILED'){
//UPDATE DATABASE TABLE BY MATCHING JOLO ORDER ID OR YOUR OWN WEBSITE ORDER ID if its unique
//REFUND to customer if not already
}
if($jolostatus=='REPORTED'){
//UPDATE DATABASE TABLE BY MATCHING JOLO ORDER ID OR YOUR OWN WEBSITE ORDER ID if its unique
}
    

Check status of transaction

In case, you do not get status updates via Synchronization method for rare transaction then you can setup this api link to get status update manually.
JSON REQUEST
Using Jolo order ID:
https://joloapi.com/api/rechargestatus.php?userid=xx&key=xx&servicetype=xx&txn=xx&type=json

Parameters:
userid = your joloapi account userid
key = your joloapi account key
txn = Jolo order ID
type= json OR text
servicetype=1 for mobile (prepaid)
servicetype=2 for dth
servicetype=3 for datacard (prepaid)
servicetype=4 for mobile & datacard (postpaid)
servicetype=5 for landline
servicetype=6 for electricity
servicetype=7 for gas
servicetype=8 for insurance
JSON RESPONSE
If request not accepted:

{
status: "FAILED",
error: "1"
}

If request accepted:

{
status: "FAILED",
error: "360",
txid: "Z2018000000000000",
clientid: "00973003714",
service: "9999999999",
amount: "99",
time: "January 01 2018 07:04:48 AM",
margin: "0",
operatorid: "0"
}

Impotant note: 
1. If request is not accepted, status will always FAILED and error will give some randowm error codes like 1,2,3,...
2. If request is accepted, status can be SUCCESS, FAILED, REPORTED along with other transaction detail.
3. You can check transaction status of current month & previous month only. If you try to check older than this period then you will get simple text response:
    "Invalid orderid or transaction is archived"
4. If transaction does not exist in our system, then you will same response:
    "Invalid orderid or transaction is archived"

Check status of transaction

In case, you do not get status updates via Synchronization method for rare transaction then you can setup this api link to get status update manually.
JSON REQUEST
Using your order ID:
https://joloapi.com/api/rechargestatus_client.php?userid=xx&key=xx&servicetype=xx&txn=xx&type=json

Parameters:
userid = your joloapi account userid
key = your joloapi account key
txn = your order ID
type= json OR text
servicetype=1 for mobile (prepaid)
servicetype=2 for dth
servicetype=3 for datacard (prepaid)
servicetype=4 for mobile & datacard (postpaid)
servicetype=5 for landline
servicetype=6 for electricity
servicetype=7 for gas
servicetype=8 for insurance
JSON RESPONSE
If request not accepted:

{
status: "FAILED",
error: "1"
}

If request accepted:

{
status: "FAILED",
error: "360",
txid: "Z2018000000000000",
clientid: "00973003714",
service: "9999999999",
amount: "99",
time: "January 01 2018 07:04:48 AM",
margin: "0",
operatorid: "0"
}

Impotant note: 
1. If request is not accepted, status will always FAILED and error will give some randowm error codes like 1,2,3,...
2. If request is accepted, status can be SUCCESS, FAILED, REPORTED along with other transaction detail.
3. You can check transaction status of current month & previous month only. If you try to check older than this period then you will get simple text response:
    "Invalid orderid or transaction is archived"
4. If transaction does not exist in our system, then you will same response:
    "Invalid orderid or transaction is archived"

Dispute of transaction

Your customer can raise dispute against any transaction whose status is SUCCESS. Customer will get refund only if service provider refunds the transaction.
JSON REQUEST
Using Jolo order ID:
https://joloapi.com/api/dispute.php?userid=xx&key=xx&servicetype=xx&txn=xx&type=json

Parameters:
userid = your joloapi account userid
key = your joloapi account key
txn = Jolo order ID
type= json OR text
servicetype=1 for mobile (prepaid)
servicetype=2 for dth
servicetype=3 for datacard (prepaid)
servicetype=4 for mobile & datacard (postpaid)
servicetype=5 for landline
servicetype=6 for electricity
servicetype=7 for gas
servicetype=8 for insurance
JSON RESPONSE
If request not accepted:

{
status: "FAILED",
error: "123"
}

If request accepted:

{
status: "REPORTED",
error: "0",
txid: "Z2018000000000000",
clientid: "00973003714",
service: "9999999999",
amount: "99"
}

Impotant note: 
1. If request is not accepted, status will always FAILED and error will give some randowm error codes like 1,2,3,...
    error 123 = you cannot dispute this transaction because status is already FAILED or REPORTED
2. If request is accepted, status will always REPORTED along with other transaction detail.
3. You can dispute transaction of last 10 days only. If you try to check older than this then you will get simple text response:
    "Invalid orderid or transaction is archived"
4. If transaction does not exist in our system, then you will same response:
    "Invalid orderid or transaction is archived"
    

Dispute of transaction

Your customer can raise dispute against any transaction whose status is SUCCESS. Customer will get refund only if service provider refunds the transaction.
JSON REQUEST
Using your order ID:
https://joloapi.com/api/dispute_client.php?userid=xx&key=xx&servicetype=xx&txn=xx&type=json

Parameters:
userid = your joloapi account userid
key = your joloapi account key
txn = your order ID
type= json OR text
servicetype=1 for mobile (prepaid)
servicetype=2 for dth
servicetype=3 for datacard (prepaid)
servicetype=4 for mobile & datacard (postpaid)
servicetype=5 for landline
servicetype=6 for electricity
servicetype=7 for gas
servicetype=8 for insurance
JSON RESPONSE
If request not accepted:

{
status: "FAILED",
error: "123"
}

If request accepted:

{
status: "REPORTED",
error: "0",
txid: "Z2018000000000000",
clientid: "00973003714",
service: "9999999999",
amount: "99"
}

Impotant note: 
1. If request is not accepted, status will always FAILED and error will give some randowm error codes like 1,2,3,...
    error 123 = you cannot dispute this transaction because status is already FAILED or REPORTED
2. If request is accepted, status will always REPORTED along with other transaction detail.
3. You can dispute transaction of last 10 days only. If you try to check older than this then you will get simple text response:
    "Invalid orderid or transaction is archived"
4. If transaction does not exist in our system, then you will same response:
    "Invalid orderid or transaction is archived"
    

Error code list api

When your api request is not accepted then you always get FAILED status along with some random error code like 1,2,3..etc. This api call is used to find out exact meaning of each error code.
JSON REQUEST
https://joloapi.com/api/errorlist1.php?&type=json

Parameters:
type= json
JSON RESPONSE

{
1: "User ID / app key missing",
2: "Operator code missing",
3: "Service code missing",
4: "Amount code missing",
5: "Client order id missing",
6: "Operator code is invalid",
7: "Amount not accepted",
8: "Amount not accepted",
9: "Invalid amount",
10: "Invalid number",
11: "Invalid number",
12: "Invalid number",
13: "Amount not accepted",
14: "Amount not accepted",
15: "Amount not accepted",
16: "Amount not accepted",
17: "Invalid amount",
18: "Invalid number",
19: "Invalid number",
20: "No IP address linked",
21: "IP address not matched",
22: "Balance is less",
23: "Balance is less",
24: "Internal server error",
25: "Same number with same amount not allowed within 60 seconds",
105: "Recharge disabled on this operator temporarly",
106: "Operator not available temporarly",
109: "Transaction already in progress at operator end",
113: "Operator-provider internal error",
129: "Operator network error",
131: "Operator Code is unavailable",
142: "Operator-provider internal error",
152: "Amount not accepted",
153: "Amount not accepted",
154: "Invalid number",
155: "Retry after 5 minutes",
162: "Customer exceeded per day attempts on this number",
163: "Amount not accepted",
164: "This customer number is barred",
165: "Amount not accepted",
166: "Invalid number",
167: "Multiple transaction error from operator on this number",
168: "Temporary operator end error",
169: "Temporary operator end error",
170: "Temporary operator end error",
171: "Temporary operator end error",
172: "Operator is down at this moment",
241: "Request parameters are incomplete",
246: "Operator-provider internal error",
247: "Invalid service provider",
248: "Duplicate transaction ID",
249: "Try after 15 minutes",
250: "Invalid account number",
251: "Invalid amount",
252: "Denomination temporarily barred",
253: "Refill barred temporarily",
254: "Service provider error",
255: "Service provider downtime",
262: "System Error",
300: "Operator code not valid for your account",
360: "Unknown error"
}