BBPS API: how do I fetch and pay a bill?

BBPS (Bharat Bill Payment System) is a bill payment system run by NPCI that connects thousands of billers, such as electricity boards, water, gas, broadband, loan repayments, insurance and credit cards, through a single network. Our BBPS API lets your platform offer these payments to customers. Most payments follow a simple two-step pattern: fetch the bill, then pay it.

Step 1: Get the biller list

Billers are grouped by category, such as Electricity, Water, Gas, Broadband or Loan Repayment. Each biller has an ID and a list of customer parameters, the details needed to identify a customer's account, such as consumer number, account number or registered mobile number.

GET /api/services/v1/bbps/billers?category=electricity

Biller lists change from time to time. Cache the list on your server and refresh it regularly rather than requesting it for every customer.

Step 2: Show the right input fields

Use the customer parameters returned for the chosen biller to build your form. Each parameter includes a name, whether it is required, and often a format rule such as length or allowed characters. Validate input against these rules before sending the fetch request.

Step 3: Fetch the bill

curl -X POST "https://www.pepploweb.com/api/services/v1/bbps/fetch" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "biller_id": "BILLER_ID",
    "params": { "consumer_number": "1234567890" },
    "reference_id": "BILL20031"
  }'

A successful fetch returns the customer's name as recorded by the biller, the bill amount, the due date, the bill number and a fetch reference:

{ "status": "success", "data": { "customer_name": "ANITA S", "amount": "1840.00",
  "due_date": "2026-12-20", "bill_number": "B98231", "fetch_ref": "FR7C21" } }

Show these details to the customer and ask them to confirm. Showing the name helps customers notice if they entered the wrong consumer number.

Step 4: Pay the bill

curl -X POST "https://www.pepploweb.com/api/services/v1/bbps/pay" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "biller_id": "BILLER_ID",
    "fetch_ref": "FR7C21",
    "amount": "1840.00",
    "reference_id": "BILL20031"
  }'

The response may be success, failed or pending, just like a recharge. A successful payment includes a BBPS transaction reference. Show it on the receipt; customers use it to check or raise a complaint about the payment.

Billers without bill fetch

Some billers do not support fetching. For these, the customer enters the amount and you call pay directly with the customer parameters. Others accept partial or advance payments. The biller details tell you which rules apply, for example whether the amount must exactly match the fetched bill.

Receipts and customer communication

A good receipt shows the biller name, customer name, consumer number, amount, date and time, your reference and the BBPS reference. Send it by SMS or email and keep it in the customer's history.

Handling pending payments

Bill payments sometimes stay pending while the biller confirms. Do not ask the customer to pay again. Wait for the webhook or check the status after a while. If the payment finally fails, the amount returns to your wallet and you should refund the customer.

Practical tips

  • Never let customers edit the amount if the biller requires the exact fetched amount.
  • Fetch the bill again if the customer returns after a long gap, because the fetch reference can expire.
  • Use a unique reference ID for every attempt.
  • Keep your biller list and categories in sync with the latest data from the API.
The examples in this article are simplified to show the flow. Field names, endpoint paths and response formats can differ by service, so always follow the current reference in our API documentation.

Learn more

See the Bharat Bill Payments API and electricity bill payments pages, and check current rates on API pricing. For help with a specific biller, open a ticket.

Was this article helpful?

Still stuck? Open a support ticket and our team will help.


Related articles

← Back

Chat with us
Hi! Send us a message and we will reply here as soon as we can.
Security check image
Chat with us