HLR Lookup API

The home location register (HLR) is a central database that contains details of each mobile phone subscriber connected to the global mobile network. You can use this API to validate that a mobile number is live and registered on a mobile network in real-time.

📘

Header Request

Accept : application/json
Content-Type: application/json
secret : Unique secret key (Provided by Pay2New)

Request Parameters

ParametersTypeMandatory (M) , Optional(O)Description
numberStringMMobile Number
request_idStringMYour Unique Transaction/Request Id (max length 20)

Sample Request

curl --request POST \
     --url https://pay2new.in/apis/offer/v1/hlr \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'secret: qwertyuQWERTY12345asdf' \
     --data '
{
     "number": "9696969696",
     "request_id": "P2N54544444545"
}
'
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://pay2new.in/apis/offer/v1/hlr",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"number\":\"9696969696\",\"request_id\":\"P2N54544444545\"}",
  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/json",
    "secret: qwertyuQWERTY12345asdf"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Response Parameters

NameTypeDescription
statusIntegerTransaction Status
messageStringMessage from API
dataArrayResponse Data (If Present)
product_codeStringProduct Code
operator_nameStringOperator Name
circle_codeStringCircle Code
circle_nameStringState Name

Sample Response

{
    "status": 1,
    "message": "Transaction Successfull!",
    "data": {
        "product_code": "1",
        "product_name": "AIRTEL",
        "circle_code": "13",
        "circle_name": "MAHARASHTRA"
    }
}
{"status":2,"message":"Invalid Json!"}
Language
Credentials
Header
Click Try It! to start a request and see the response here!