WhatsApp and Razorpay Integration

Jahnavi Prasad Updated by Jahnavi Prasad

WATI can be integrated with Razorpay to:

This integration is set up via Pabbly Connect (both free or professional versions can be used)
  1. Create the Template message you would like to send the link in.
    This template message must contain a Dynamic Call to Action button.
    The button URL should be https://rzp.io/{{pay_link}}. We will populate the {{pay_link}} dynamically
  2. Create a new workflow in Pabbly Connect (https://connect.pabbly.com/)
  3. Choose Trigger as Webhook by Pabbly.
    This is the webhook to which we will send the phone number of the receiver and the cart amount they have to pay
    Depending on your eCommerce software, you might be able to directly send this data to the webhook.
  4. In our case, we are asking the user for their cart value and then creating 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)
  5. Once we have the inputs necessary (phone number and cart value) we have to perform a multiplication operation on the cart value because the amount must be in the smallest unit of the currency. For example, pass 42000 for ₹420.
    If you use instamojo, use the format to two decimals, e.g 420.00
    Choose App: Number Formatter by Pabbly. Action Event: Perform Math Operation
  6. Now we can create the payment link using RazorPay Gateway.
    Choose App: Razorpay. Action Event: Create Payment Link
    Create a connection with your Razorpay account
    Pass the Amount from the previous step. Pass the Contact from step 1.
    Choose the Currency, Description, Expire (set to maximum: 32503663800), and Callback URL
    Click Save & Send Test Request and see if a Link is generated in the Short URL field
  7. Now that the link is generated, we will split it to fetch only the dynamic part of the link
    Choose App: Text Formatter by Pabbly. Action Event: Replace Text
  8. Now we send a template message using WATI.
    Choose App: WATI. Action Event: Send Template Message
    Pass the phone number to WhatsApp Number field and the split link from previous step in Custom Params as shown below.

This workflow will receive the data through webhook, creates a payment link and then sends it via WhatsApp

Use Case #2: Send confirmation once the payment is received

  1. Create a template message to be sent whenever a payment is received
  2. Create a new workflow in Pabbly.
    Step 1, Choose App: Razorpay. Trigger Event: Payment Captured
    This generates a Webhook URL. Copy this and follow the steps to paste it in your Razorpay account.
  3. In Step 2, Choose App: WATI. Trigger Event: Send Template Message
    Map the WhatsApp number and custom params as per the template message

This should automatically capture all incoming payments and send a WhatsApp message to the phone number they entered while completing the payment.

How did we do?

Google Calendar Integration