Collect a Payment in a Chatbot
The Collect Payment block sends the customer a WhatsApp order: your items, their prices and a total, with WhatsApp’s Review and pay button. They pay without leaving the chat, through your own Razorpay or PayU account, and your bot carries on from On paid or On failed.
Use it for anything with a price you know at that point in the chat: a consultation fee, a booking advance, course fees, a quote you just worked out. You don’t need a product catalog.
Add the block
Section titled “Add the block”-
In Bot Builder, open a flow and click Add New Block → Collect Payment.
-
Write the Message shown above the order, for example “Please pay to confirm your booking.” If you leave it empty, the customer sees “Please complete the payment to confirm your order”.
-
Add your Order items: a name, a price in rupees and a quantity for each. The Total adds them up.
-
Optionally add a Footer, a Message After Payment and a Message If Payment Fails.
-
Connect On paid and On failed on the canvas (see below), then save the flow.
Prices and quantities
Section titled “Prices and quantities”- Whole rupees only.
1499,1,499and₹1499all work.99.50is refused, and the block goes to On failed rather than rounding. - Quantity is optional and defaults to 1. It must be a whole number of 1 or more.
- Empty rows are skipped. An order needs at least one item and a total above ₹0.
- No tax is added. The customer pays exactly the total of your items. The Tax Percentage in Order Management is only for catalog orders.
Use variables for amounts that change
Section titled “Use variables for amounts that change”Name, price and quantity can all use variables from earlier in the flow, so one block can charge each customer a different amount:
| Write | Comes from |
|---|---|
{{reportFee}} | A value saved earlier in the flow: a Question block’s answer, or a value saved by an HTTP Request block from your own system |
{{$name}} | The contact’s name, for example in an item name like Consultation for {{$name}} |
When the price uses a variable, the editor shows the total as Worked out when sent.
On paid and On failed
Section titled “On paid and On failed”
The block waits after it sends the order. Nothing after it runs until WhatsApp tells us how the payment went.
| What happened | What runs |
|---|---|
| The customer paid | Message After Payment, then On paid. If On paid isn’t connected, the block’s normal output runs instead. |
| The payment failed | Message If Payment Fails, then On failed |
| The order couldn’t be sent at all | Message If Payment Fails, then On failed, straight away |
If you leave a message empty and connect nothing, the customer still gets a default: “Payment received. Thank you!” or “Payment failed. Please try again.”
Things to put after On paid: a confirmation, Update Contact to set a status or tag, a link to the next step. After On failed: a retry nudge, or Start Live Chat so your team can help.
When On failed runs straight away
Section titled “When On failed runs straight away”The block sends nothing and goes to On failed at once if:
- payments aren’t set up in Order Management
- an item has no name, the price isn’t a whole number, or the quantity is below 1
- there are no items, or the total is ₹0
The editor warns you about the first one:
Open Order Management ↗ opens the settings in a new tab. When you come back to the flow, the warning clears on its own once payments are set up.
See every payment in Payments and orders in the inbox.