Create a Bill Payment | BBPS API | Razorpay
Confirm a BBPS bill payment on the NPCI network after collecting money via the Razorpay Payment Gateway. Returns processing status with a bill payment id to poll for the final outcome.
processing status with a bill payment id. Poll the Fetch Bill Payment API or listen to webhooks until the status reaches a terminal state (success or failed).
X-Bill-Payments-Idempotency header (4–36 characters, alphanumeric with hyphens, underscores or spaces) to safely retry requests without creating duplicate payments. A UUID v4 is recommended. The request body on retries must match the original request, else it is rejected as a BAD_REQUEST_ERROR.- Normal Pay - used when a bill is retrieved first via Create a Bill Request. Pass
bill_request_id. - Direct Pay - used when the biller’s
bill_request_requiredflag isoptionalornot_supportedand you skip the bill retrieval step. Passbiller_id(orgateway_biller_id),biller_data.account_holderanddeviceinstead.
Request Parameters
device and biller_data.account_holder become mandatory. For example, billreq_ERNEungCtXpZqM.gateway_biller_id is not provided.biller_id is not provided. For example, TPOW00000MUM01.payment_config.amount_exactness rule (exact, exact_or_above, exact_or_below or any). This value can be less or more than an individual bill amount. For example, 1015 represents ₹10.15.INR.0 for components that do not apply.0 if not applicable.fee_config.fee_types[].fee_code=CCF1 returned by the Fetch Billers API and to NPCI’s custConvFee. Pass 0 if the biller charges no CCF.pay_MbJ5AvwNpAkfLB.razorpay when the payment is processed via the Razorpay gateway.INR is supported currently.paymentMode. Supported values: card, upi, netbanking, wallet.method is card.credit, debit, prepaid.Card as per NPCI guidelines.method is upi.method is netbanking.PG.method is wallet.amazon_pay, payzapp.[] for Direct Pay (no bill was retrieved).bills[].bill_number received in the Fetch Bill Request response. Required when a bill was retrieved.payment_config.amount_exactness rules.INR.919000090000.bill_request_id is not provided.account_holder_config returned by the Fetch Billers API. Razorpay does not control the keys nor the values - pass them exactly as defined by the biller.bill_request_id is not provided.internet- Webmobile- Mobile Apppos- Point of Salempos- Mobile Point of Sale
pos, mpos channels.internet, mobile, pos, mpos channels. For example, 12.9667,77.5667.internet, mobile channels.internet channels. For example, 00-0D-60-07-2A-F0.mobile, mpos channels. For example, android, iOS.mobile, mpos channels. For example, amazon_pay.mobile initiating channel.Response Parameters
bill_pay_xxxx.bill_payment.payment.processing on the create response. Poll Fetch Bill Payment for the final state. Possible final values: success (NPCI responseCode=000), pending (NPCI responseCode=091) or failed (any other NPCI responseCode).txnReferenceId. Store for NPCI reconciliation, settlement tracking and dispute resolution.bbps.Errors
The `ref_id` is required.
The `ref_id` is required.
400ref_id is required.Solution: Pass either a valid bill_request_id (Normal Pay) or the Direct Pay fields (biller_id, biller_data.account_holder, device).The `bill_request_id` is invalid or expired.
The `bill_request_id` is invalid or expired.
400Invalid or expired ref_id.Solution: Use a bill_request_id from a successful bill request that has not yet expired (expiry_at).The `bill_pay_amount` does not match the fetched amount.
The `bill_pay_amount` does not match the fetched amount.
400Payment amount does not match fetch/validate amount.Solution: Use the bill.amount returned in the successful bill request or pass a value that satisfies the biller’s amount_exactness rules.The customer parameters do not match the bill request.
The customer parameters do not match the bill request.
400Customer parameters do not match fetch/validate request.Solution: Pass the same customer parameters used during the bill request.The payment method is not supported for this biller.
The payment method is not supported for this biller.
400Payment method not supported for this biller.Solution: Check the biller’s supported payment_config.methods and retry with a supported method.The payment amount exceeds the maximum limit.
The payment amount exceeds the maximum limit.
400Payment amount exceeds maximum limit of {max_amount} for {payment_mode}.Solution: Pass an amount within the biller’s payment_config.methods[].max_limit or split across methods.Required payment instrument details are missing.
Required payment instrument details are missing.
400Required payment instrument details missing for {payment_mode}.Solution: Include the appropriate sub-object (card, upi, netbanking, wallet) with all mandatory fields.The `X-Bill-Payments-Idempotency` header is missing or invalid.
The `X-Bill-Payments-Idempotency` header is missing or invalid.
400The idempotency key must be 4-36 characters and contain only alphanumeric characters, hyphens, underscores or spaces.Solution: Provide a unique idempotency key. A UUID v4 is recommended.Bill payment failed at biller.
Bill payment failed at biller.
502The biller rejected the bill payment.Solution: Check metadata.payment_id and initiate a refund on the PG payment if money was collected.Duplicate payment at biller.
Duplicate payment at biller.
502Bill payment failed at biller because of a duplicate payment.Solution: Poll Fetch Bill Payment for the original payment status before retrying.Payment request timed out at NPCI.
Payment request timed out at NPCI.
502NPCI did not respond within the timeout window.Solution: Poll Fetch Bill Payment for the final state. Do not retry until status reaches success or failed.The API `<key/secret>
` provided is invalid.
The API `<key/secret> ` provided is invalid.
401The API credentials passed in the request differ from the ones generated on the Dashboard.Solution: Ensure your API key and secret are correct and active.