Summary
This article provides a step-by-step guide on how to integrate Wati with Razorpay using Pabbly Connect to automate payment-related notifications via WhatsApp. You will learn how to send payment links and payment confirmation messages.
This integration is set up via Pabbly Connect (both free or professional versions can be used)
Instructions
Use Case 1: Sending Payment Links via WhatsApp
This setup will allow you to automatically send payment links to customers via WhatsApp.
Step 1: Create a Template Message in Wati
Create a new template message in Wati for sending payment links.
Include a Dynamic Call to Action button in your template.
Set the button URL to
https://rzp.io/##{{pay_link}}
. The##{{pay_link}}
will be dynamically populated with the actual payment link.
Step 2: Create a New Workflow in Pabbly Connect
Go to Pabbly Connect and create a new workflow.
Choose Webhook by Pabbly as the trigger. This will generate a webhook URL. You will send the recipient's phone number and cart amount to this webhook.
Note: Depending on your e-commerce software, you might be able to directly send data to this webhook.
Optional: You can import a pre-built JSON file:
UPI Integration.json
. Click the Import JSON button next to Add Flow on the Flows page in Pabbly Connect.
For this example, we are manually asking the user for their cart value. Hence, we need to create a payment link for that amount.
JSON file of this Flow: UPI Integration.json (Click the Import JSON button beside Add Flow in Flows page)
Step 3: Format the Cart Value
Choose Number Formatter by Pabbly as the app.
Select Perform Math Operation as the action event.
Multiply the cart value by 100 because Razorpay requires the amount in the smallest currency unit. For example, enter 42000 for ₹420.
Note*:* If you are using Instamojo, format the amount to two decimals (e.g., 420.00).
Step 4: Create the Payment Link Using Razorpay
Choose Razorpay as the app.
Select Create Payment Link as the action event.
Create a connection with your Razorpay account.
Pass the amount from the previous step, and the phone number from Step 1.
Choose the Currency, add a Description, set the Expire time (maximum: 32503663800), and provide a Callback URL.
Click Save & Send Test Request to check if a link is generated in the Short URL field.
Step 5: Split the Link to Extract the Dynamic Part
Choose Text Formatter by Pabbly as the app.
Select Replace Text as the action event.
This step will help you extract the dynamic part of the generated link.
Step 6: Send the Template Message via Wati
Choose WATI as the app.
Select Send Template Message as the action event.
Pass the phone number to the WhatsApp Number field and the split link from the previous step in Custom Params, as shown below:
NoneBashCSSCC#ElixirErlangGoGraphQLGroovyHaskellHTMLINIJavaJavaScriptJSONJSXKotlinLispLuaMermaid DiagramNixObjective-COCamlPerlPHPPowershellPythonRubyRustScalaSQLSoliditySwiftTOMLTSXTypeScriptVisual BasicYAMLZigCopy
{"pay_link":"the_dynamic_part_of_the_link"}
This workflow will receive data through a webhook, create a payment link, and send it via WhatsApp.
Use Case 2: Send Confirmation Once Payment is Received
This setup will automatically send a confirmation message to customers via WhatsApp when their payment is received.
Step 1: Create a Template Message in Wati
Create a template message to be sent whenever a payment is received.
Step 2: Create a New Workflow in Pabbly Connect
Choose Razorpay as the app.
Select Payment Captured as the trigger event. This will generate a Webhook URL.
Copy this Webhook URL and paste it into your Razorpay account settings.
Step 3: Send the Confirmation Message via Wati
Choose WATI as the app.
Select Send Template Message as the action event.
Map the WhatsApp number and custom parameters according to your template message.
This automation will capture all incoming payments and send a WhatsApp message to the phone number provided during payment.
Frequently Asked Questions (FAQs)
General Questions
1. What is the purpose of this integration?
→ This integration allows you to automate payment-related notifications via WhatsApp, such as sending payment links and payment confirmations.
2. What tools are required for this integration?
→ You need a Wati account, a Razorpay account, and a Pabbly Connect account.
3. Can I use the free version of Pabbly Connect for this integration?
→ Yes, both the free and professional versions of Pabbly Connect can be used.
Sending Payment Links via WhatsApp
4. What should the Dynamic Call to Action button URL be in the Wati template message?
→ The button URL should be https://rzp.io/##{{pay_link}}
.
5. What trigger should I choose in Pabbly Connect for sending payment links?
→ Choose "Webhook by Pabbly" as the trigger.
6. Why do I need to format the cart value in Pabbly Connect?
→ Razorpay requires the amount in the smallest currency unit. You need to multiply the cart value by 100 (e.g., enter 42000 for ₹420).
7. Which action event should I select in the Razorpay app in Pabbly Connect?
→ Select "Create Payment Link" as the action event.
8. What information should I pass to the Razorpay "Create Payment Link" action?
→ You should pass the amount, phone number, currency, description, expire time, and a callback URL.
9. Why do I need to split the link in Pabbly Connect?
→ Splitting the link helps extract the dynamic part of the generated payment link.
Sending Payment Confirmations via WhatsApp
10. What trigger should I choose in Pabbly Connect for sending payment confirmations?
→ Choose "Payment Captured" as the trigger event for the Razorpay app.
11. Where do I paste the Webhook URL generated by Pabbly Connect?
→ You need to paste the Webhook URL into your Razorpay account settings.
12. What do I need to configure in the Wati "Send Template Message" action for payment confirmations?
→ You need to map the WhatsApp number and custom parameters according to your template message.