Create a Bill Request
POST/v1/bill_payments/bill_requestsClick to copy
Use this endpoint to either retrieve the outstanding bill amount for a customer from a biller or validate the customer's account details when the biller does not support bill retrieval. This is an asynchronous API. The response immediately returns a bill request in processing status. Poll the
id until the status reaches success or failed.When to use this API
- When the biller's
bill_request_config.bill_request_requiredismandatory- call this API to retrieve the bill before payment. - When
bill_request_requiredisoptional- call this API to validate the customer's account or skip and use Direct Pay. - When
bill_request_requiredisnot_supported- skip this step and call directly.
Polling URL
Poll for the final state using GET /v1/bill_payments/bill_requests/{id} with the id from the response.
Is this page helpful?
Curl
1curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \2-X POST https://api.razorpay.com/v1/bill_payments/bill_requests \3-H "Content-Type: application/json" \4-d '{5"biller_id": "biller_001",6"gateway_biller_id": "TPOW00000MUM01",7"customer": {8"id": "rzp_cust_123",9"name": "Gaurav Kumar",10"mobile": "919000090000",11"email": "gaurav.kumar@example.com"12},13"device": {14"initiating_channel": "MOB",15"mobile": "9999999999",16"geocode": "12.9667,77.5667",17"ip": "198.1.1.1",18"mac": "00-0D-60-07-2A-F0",19"os": "android",20"app": "amazon_pay"21},22"biller_data": {23"account_holder": {24"AccountNumber": "XXXXXXX",25"mobile": "XXXXXXX",26"AccountHolderName": "Gaurav Kumar",27"<KEY>": "<VALUE>"28}29}30}'
Success (state=processing)
Failure (state=failed)
1{2"id": "billreq_ERNEungCtXpZqM",3"entity": "bill_payment.bill_request",4"status": "processing",5"customer": {6"id": "rzp_cust_123",7"name": "Gaurav Kumar",8"mobile": "919000090000",9"email": "gaurav.kumar@example.com"10},11"biller_id": "biller_001",12"gateway_biller_id": "TPOW00000MUM01",13"gateway": "bbps",14"created_at": 160945920015}
Request Parameters
biller_id string Razorpay's internal biller id sent in biller info. One of biller_id or gateway_biller_id is mandatory.
gateway_biller_id string NPCI biller id (for example, TPOW00000MUM01). One of biller_id or gateway_biller_id is mandatory.
customer objectCustomer information passed as dynamic key-value pairs. Free-form metadata for your own tracking and reconciliation. Razorpay echoes these back on responses and webhooks without validation.
customer.id stringDynamic key-value pair holding your customer reference. Not validated by Razorpay.
customer.name stringDynamic key-value pair holding the customer name. Not validated by Razorpay.
customer.mobile *
stringCustomer mobile number provided at payment create on PA.
customer.email stringDynamic key-value pair holding the customer email. Not validated by Razorpay.
device *
objectInfo about the bill payment initiating device.
device.initiating_channel *
enumThe channel from which the bill request is initiated, based on NPCI terminology. Values:
INT- WebMOB- Mobile AppMOBB- Mobile Banking AppINTB- Internet BankingAGT- AgentBNKBRNCH- Bank BranchBSC- Business Correspondent
device.app string Application name (for example, amazon_pay). Required for MOB, MOBB initiating channels.
device.mobile stringNPCI channel requirements - End agent's mobile number for offline channels like BNKBRNCH, AGT, BSC initiating channels.
device.geocode string NPCI channel requirements - Latitude, Longitude (for example, 12.9667,77.5667). Required for INT, MOB, BNKBRNCH, AGT, BSC channels.
device.ip stringNPCI channel requirements - IP address (IPv4 or IPv6). Required for INT, INTB, MOB, MOBB initiating channels.
device.mac stringMAC address. Required for INT, INTB channels.
device.os string Operating system. Required for MOB, MOBB channels. For example, android, iOS.
biller_data *
objectBill account holder details. Required for every bill request irrespective of the pay flow.
biller_data.account_holder *
object Dynamic key-value pairs that identify the customer's account at the biller. Razorpay does not control the keys nor the values. Pass them exactly as defined in the biller's account_holder_config returned by the
Response Parameters
idstring Razorpay's bill request id created. Store for reference and reconciliation. For example, billreq_ERNEungCtXpZqM.
entitystring Entity type. Always bill_payment.bill_request.
statusstring Request status. Possible values: processing, success, failed. To take next action if the status is not terminal (success or failed), continue polling.
customerobjectCustomer reference details echoed from the request as dynamic key-value pairs. Returned only when sent in the request. Free-form metadata that you can use for your own tracking and reconciliation.
customer.id stringDynamic key-value pair holding your customer reference. Echoed back exactly as sent in the request. Not validated by Razorpay.
customer.name stringDynamic key-value pair holding the customer name. Echoed back exactly as sent in the request. Not validated by Razorpay.
customer.mobile *
stringCustomer mobile number provided at payment create on PA.
customer.email stringDynamic key-value pair holding the customer email. Echoed back exactly as sent in the request. Not validated by Razorpay.
biller_idstringRazorpay's internal biller id, same as sent in request. Use for reference and reconciliation.
gateway_biller_idstringNPCI biller id sent in request. Use for reference and reconciliation.
gatewaystring Bill payment gateway used. Default value is bbps.
created_atintegerRequest created timestamp at Razorpay (Unix seconds). Audit trail.
Errors
The biller_id is missing or invalid.
Error Status: 400
The biller id provided does not correspond to a valid or active biller.
Solution
The gateway_biller_id is missing.
Error Status: 400
biller_id is required.
Solution
The biller_data.account_holder values are invalid.
Error Status: 400
Invalid customer parameter format for {param_name}.
Solution
Device information is incomplete.
Error Status: 400
Device information is incomplete. Missing required field for the initiating channel.
Solution
No bill found for the provided customer parameters.
Error Status: 502
No bill found at the biller for the customer details provided.
Solution
Unable to fetch bill from NPCI.
Error Status: 502
NPCI did not respond within the timeout window.
Solution
Invalid or missing customer account holder data.
Error Status: 502
The biller rejected the account holder data as invalid or incomplete.
Solution
Biller system temporarily unavailable.
Error Status: 502
The biller is temporarily unavailable to retrieve the bill.
Solution
Bill retrieval is not valid for this biller.
Error Status: 400
The biller does not support bill retrieval.
Solution
The API <key/secret> provided is invalid.
Error Status: 401
The API credentials passed in the request differ from the ones generated on the Dashboard.
Solution
Create a Bill Request
POST/v1/bill_payments/bill_requestsClick to copy
Use this endpoint to either retrieve the outstanding bill amount for a customer from a biller or validate the customer's account details when the biller does not support bill retrieval. This is an asynchronous API. The response immediately returns a bill request in processing status. Poll the
id until the status reaches success or failed.When to use this API
- When the biller's
bill_request_config.bill_request_requiredismandatory- call this API to retrieve the bill before payment. - When
bill_request_requiredisoptional- call this API to validate the customer's account or skip and use Direct Pay. - When
bill_request_requiredisnot_supported- skip this step and call directly.
Polling URL
Poll for the final state using GET /v1/bill_payments/bill_requests/{id} with the id from the response.
Is this page helpful?
Request Parameters
biller_id string Razorpay's internal biller id sent in biller info. One of biller_id or gateway_biller_id is mandatory.
gateway_biller_id string NPCI biller id (for example, TPOW00000MUM01). One of biller_id or gateway_biller_id is mandatory.
customer objectCustomer information passed as dynamic key-value pairs. Free-form metadata for your own tracking and reconciliation. Razorpay echoes these back on responses and webhooks without validation.
customer.id stringDynamic key-value pair holding your customer reference. Not validated by Razorpay.
customer.name stringDynamic key-value pair holding the customer name. Not validated by Razorpay.
customer.mobile *
stringCustomer mobile number provided at payment create on PA.
customer.email stringDynamic key-value pair holding the customer email. Not validated by Razorpay.
device *
objectInfo about the bill payment initiating device.
device.initiating_channel *
enumThe channel from which the bill request is initiated, based on NPCI terminology. Values:
INT- WebMOB- Mobile AppMOBB- Mobile Banking AppINTB- Internet BankingAGT- AgentBNKBRNCH- Bank BranchBSC- Business Correspondent
device.app string Application name (for example, amazon_pay). Required for MOB, MOBB initiating channels.
device.mobile stringNPCI channel requirements - End agent's mobile number for offline channels like BNKBRNCH, AGT, BSC initiating channels.
device.geocode string NPCI channel requirements - Latitude, Longitude (for example, 12.9667,77.5667). Required for INT, MOB, BNKBRNCH, AGT, BSC channels.
device.ip stringNPCI channel requirements - IP address (IPv4 or IPv6). Required for INT, INTB, MOB, MOBB initiating channels.
device.mac stringMAC address. Required for INT, INTB channels.
device.os string Operating system. Required for MOB, MOBB channels. For example, android, iOS.
biller_data *
objectBill account holder details. Required for every bill request irrespective of the pay flow.
biller_data.account_holder *
object Dynamic key-value pairs that identify the customer's account at the biller. Razorpay does not control the keys nor the values. Pass them exactly as defined in the biller's account_holder_config returned by the
Response Parameters
idstring Razorpay's bill request id created. Store for reference and reconciliation. For example, billreq_ERNEungCtXpZqM.
entitystring Entity type. Always bill_payment.bill_request.
statusstring Request status. Possible values: processing, success, failed. To take next action if the status is not terminal (success or failed), continue polling.
customerobjectCustomer reference details echoed from the request as dynamic key-value pairs. Returned only when sent in the request. Free-form metadata that you can use for your own tracking and reconciliation.
customer.id stringDynamic key-value pair holding your customer reference. Echoed back exactly as sent in the request. Not validated by Razorpay.
customer.name stringDynamic key-value pair holding the customer name. Echoed back exactly as sent in the request. Not validated by Razorpay.
customer.mobile *
stringCustomer mobile number provided at payment create on PA.
customer.email stringDynamic key-value pair holding the customer email. Echoed back exactly as sent in the request. Not validated by Razorpay.
biller_idstringRazorpay's internal biller id, same as sent in request. Use for reference and reconciliation.
gateway_biller_idstringNPCI biller id sent in request. Use for reference and reconciliation.
gatewaystring Bill payment gateway used. Default value is bbps.
created_atintegerRequest created timestamp at Razorpay (Unix seconds). Audit trail.
Errors
The biller_id is missing or invalid.
Error Status: 400
The biller id provided does not correspond to a valid or active biller.
Solution
The gateway_biller_id is missing.
Error Status: 400
biller_id is required.
Solution
The biller_data.account_holder values are invalid.
Error Status: 400
Invalid customer parameter format for {param_name}.
Solution
Device information is incomplete.
Error Status: 400
Device information is incomplete. Missing required field for the initiating channel.
Solution
No bill found for the provided customer parameters.
Error Status: 502
No bill found at the biller for the customer details provided.
Solution
Unable to fetch bill from NPCI.
Error Status: 502
NPCI did not respond within the timeout window.
Solution
Invalid or missing customer account holder data.
Error Status: 502
The biller rejected the account holder data as invalid or incomplete.
Solution
Biller system temporarily unavailable.
Error Status: 502
The biller is temporarily unavailable to retrieve the bill.
Solution
Bill retrieval is not valid for this biller.
Error Status: 400
The biller does not support bill retrieval.
Solution
The API <key/secret> provided is invalid.
Error Status: 401
The API credentials passed in the request differ from the ones generated on the Dashboard.
Solution
Curl
1curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \2-X POST https://api.razorpay.com/v1/bill_payments/bill_requests \3-H "Content-Type: application/json" \4-d '{5"biller_id": "biller_001",6"gateway_biller_id": "TPOW00000MUM01",7"customer": {8"id": "rzp_cust_123",9"name": "Gaurav Kumar",10"mobile": "919000090000",11"email": "gaurav.kumar@example.com"12},13"device": {14"initiating_channel": "MOB",15"mobile": "9999999999",16"geocode": "12.9667,77.5667",17"ip": "198.1.1.1",18"mac": "00-0D-60-07-2A-F0",19"os": "android",20"app": "amazon_pay"21},22"biller_data": {23"account_holder": {24"AccountNumber": "XXXXXXX",25"mobile": "XXXXXXX",26"AccountHolderName": "Gaurav Kumar",27"<KEY>": "<VALUE>"28}29}30}'
Success (state=processing)
Failure (state=failed)
1{2"id": "billreq_ERNEungCtXpZqM",3"entity": "bill_payment.bill_request",4"status": "processing",5"customer": {6"id": "rzp_cust_123",7"name": "Gaurav Kumar",8"mobile": "919000090000",9"email": "gaurav.kumar@example.com"10},11"biller_id": "biller_001",12"gateway_biller_id": "TPOW00000MUM01",13"gateway": "bbps",14"created_at": 160945920015}