| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Fetch or validate a bill before payment. Store the returned order_id and send it as bill_fetch_order_id in the bill-payment request.
Endpoint
POST https://pay2new.in/apis/offer/v1/billFetch
Headers
| Header | Required | Value / description |
|---|---|---|
secret | Yes | Your Pay2New API secret. Keep it on your server. |
Content-Type | Yes for JSON requests | application/json |
Accept | Optional | application/json |
Authentication
Use an active Pay2New partner account with verified KYC, an active wallet and API access. Send requests from your registered IP address. Enable the relevant service where applicable; offer services may also require an active plan.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
number | string | Yes | Mobile, subscriber or bill account number for the selected product. |
product_code | string | Yes | Product/operator code returned by the Product List API. |
amount | decimal string | No | Amount used when the selected biller requires bill validation; omit unless instructed. No general amount validation is enforced on this fetch endpoint. |
request_id | string | Yes | Unique client reference for this request. Store it for reconciliation and support. |
optional1 | string | No | Additional product-specific input. Omit unless the product requires it or Pay2New instructs you to send it. |
optional2 | string | No | Additional product-specific input. Omit unless the product requires it or Pay2New instructs you to send it. |
optional3 | string | No | Additional product-specific input. Omit unless the product requires it or Pay2New instructs you to send it. |
optional4 | string | No | Additional product-specific input. Omit unless the product requires it or Pay2New instructs you to send it. |
customer_number | string | Yes | Customer mobile number; exactly 10 numeric digits. |
latitude | decimal string | Yes | Customer/outlet latitude as a decimal value. |
longitude | decimal string | Yes | Customer/outlet longitude as a decimal value. |
pincode | string | Yes | Exactly 6 characters; send a valid Indian PIN code. |
ip | string | Yes | End-user IPv4 address. |
outletId | string | Yes | Active Pay2New customer/outlet ID. Send this field in the JSON body. |
Request example
Illustrative values
All identifiers, identity data, amounts and IP addresses in these examples are synthetic. Replace the secret, product/customer references and sample inputs with the values for your integration before sending a request.
curl --request POST \
--url 'https://pay2new.in/apis/offer/v1/billFetch' \
--header 'secret: <YOUR_PAY2NEW_SECRET>' \
--header 'Content-Type: application/json' \
--data '{
"number": "9999999999",
"product_code": "1",
"request_id": "EXAMPLE202609260001",
"customer_number": "9999999999",
"latitude": "19.0760",
"longitude": "72.8777",
"pincode": "400001",
"ip": "203.0.113.10",
"outletId": "YOUR_OUTLET_ID"
}'
Response fields
| Field | Type | Description |
|---|---|---|
status | integer | 1: successful operation; 2: failed/rejected operation; 3: pending or indeterminate where returned. |
message | string | Human-readable result or error message. |
data | object / array | Service/provider response data. Available keys depend on the selected product and verification source; allow missing or null optional fields. |
order_id | string | Pay2New transaction/order reference. Store it for reconciliation. |
Response example
{
"status": 1,
"message": "Transaction Successful!",
"data": {},
"order_id": "P2N_EXAMPLE_BILL_FETCH"
}
Integration notes
The selected biller determines which optional fields and bill details apply. Some products validate the bill rather than returning a bill amount. If instructed for such a product, supply its amount along with the required fields. Use the returned order_id as bill_fetch_order_id when paying.
Errors
Application failures return status: 2 and a message. Invalid fields can also be identified in an errors object. Authentication, IP registration, service access and product availability can prevent processing. Other response fields may be absent when processing fails before a transaction is created. Evaluate the JSON result even when the HTTP request completes successfully. Preserve your request and order references when an outcome is pending or indeterminate.
{
"status": 2,
"message": "Invalid Parameters",
"errors": {
"number": "Illustrative field validation message"
}
}
