Bill Fetch

📘

Header Request

secret : Unique secret key (Provided by Pay2New)

Request Parameters

ParametersTypeMandatory (M) , Optional(O)Description
numberStringMBilling number
product_codeStringMUnique Operator Code
request_idStringMYour Unique Transaction Id
optional1StringODepends on Operator
optional2StringODepends on Operator
optional3StringODepends on Operator
optional4StringODepends on Operator
request_idStringMUnique Request Number
customer_numberStringMCustomer mobile number
pincodeStringMCustomer pin code
latitudeStringMCurrent location latitude
longitudeStringMCurrent location longitude
ipStringMOnboard User Ip address
outletIdIntegerMProvide by Pay2New

Sample Request

curl --location 'https://pay2new.in/apis/offer/v1/billFetch' \
--header 'secret: qwertyuQWERTY12345asdf' \
--header 'Content-Type: application/json' \
--data '{
    "number": "123456789321",
    "product_code": "400",
    "request_id": "P2N54544444545",
    "optional1": "2640",
    "optional2": "",
    "optional3": "",
    "optional4": "",
    "customer_number": "9876543210",
    "pincode": "414002",
    "latitude": "19.1258",
    "longitude": "74.7453",
    "ip": "30.169.159.167",
    "outletId": 2
}'
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://pay2new.in/apis/offer/v1/billFetch',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
     "number": "123456789321",
    "product_code": "400",
    "request_id": "P2N54544444545",
    "optional1": "2640",
    "optional2": "",
    "optional3": "",
    "optional4": "",
    "customer_number": "9876543210",
    "pincode": "414002",
    "latitude": "19.1258",
    "longitude": "74.7453",
    "ip": "30.169.159.167",
    "outletId": 2
}',
  CURLOPT_HTTPHEADER => array(
    'secret: qwertyuQWERTY12345asdf',
    'Content-Type: application/json',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Response Parameters

ParametersTypeDescription
statusIntegerPay2New status code
messageStringMessage from API
dataArrayResponse Data (If Present)
data.customer_nameStringBill Holder Customer name
data.bill_periodStringBill Period
data.bill_dateStringBill date
data.bill_due_dateStringLast date of Bill Pay
data.bill_numberStringBill number
data.amountStringBill amount
order_idStringTransaction Id ( If transaction otherwise it is null )

Sample Response

{
    "status": 1,
    "message": "Transaction Successful",
    "data": {
        "customer_name": "Test",
        "bill_period": "MONTHLY",
        "bill_date": "15/04/2023",
        "bill_due_date": "06/05/2023",
        "bill_number": "123456789",
        "amount": "1350.00"
    },
    "order_id": "P2N5452534158DFOLASDF"
}
Language
Click Try It! to start a request and see the response here!