Platform
Chatbot Builder Bulk Messaging Team Inbox Mini CRM API & Webhooks AI Integration WhatsApp Flows
Industries
E-commerce & D2C Real Estate Education Healthcare Finance & BFSI Logistics Hospitality Retail
Integrations
Learn
Learning Hub Help & Docs Connect Guides Automation Codex Blog Message Templates
Pricing Get Started →
Connect  ›  Connect Razorpay to WhatsApp
Payment connection guide

Connect Razorpay to WhatsApp

Generate a payment link inside a WhatsApp flow and send it to the customer in the same message. This guide covers every field in the External API Request step for Razorpay's payment links endpoint.

 Published 21 June 2026  9 min read  Live-researched  India-first

Razorpay is the most widely used payment gateway in India. The External API Request step lets your WhatsApp bot generate a payment link on the fly, capture the link from the API response, and send it to the customer in the same conversation, all without leaving WhatsApp or opening a browser.

The most useful thing to do with the Razorpay API inside WhatsApp is create a payment link. The link is a hosted Razorpay checkout page the customer can pay on using UPI, cards, or net banking. This guide focuses on exactly that.

New to the External API Request step? Read the foundation guide first.

Step 1: Get your Razorpay API keys

1

Log in to your Razorpay Dashboard

Go to dashboard.razorpay.com and log in.
2

Go to Settings, then API Keys

In the left menu, open Settings and then API Keys. Choose the mode: Test for development, Live for real payments.
3

Generate and copy both keys

Click Generate Key. You receive a Key ID (starts rzp_test_ or rzp_live_) and a Key Secret. Copy both immediately. The secret is shown only once.

 Test first, then go live

Razorpay gives you separate test and live credentials. Use the test key while building your flow; no real money moves. Switch to the live key only when you are ready to accept actual payments. The API endpoint and request format are identical for both.

Step 2: Fill in the External API Request step

External API Request
Method
POST
Request URL
https://api.razorpay.com/v1/payment_links
Auth Type
Basic Auth
Header Parameters
Authorization
Basic base64(key_id:key_secret)
Content-Type
application/json
Body Type
JSON (raw)
Response Type
Default Response
SaveRun and Save

Auth type: Basic Auth

Razorpay uses HTTP Basic Auth. In the External API Request step, select Basic Auth and enter your Key ID as the username and your Key Secret as the password. The step handles the base64 encoding for you. The resulting header looks like Authorization: Basic ENCODED_STRING.

Request URL

Request URL
https://api.razorpay.com/v1/payment_links

Body

 Amount is in paise, not rupees

Razorpay takes the amount field in the smallest currency unit. For INR that is paise: 1 rupee = 100 paise. So to create a link for Rs 500, set amount to 50000. This is the most common mistake in first integrations.

JSON body
{
  "amount": 50000,
  "currency": "INR",
  "description": "Payment for Order #{{order_id}}",
  "customer": {
    "name": "{{customer_name}}",
    "contact": "{{customer_phone}}",
    "email": "{{customer_email}}"
  },
  "notify": {
    "sms": false,
    "email": false
  },
  "reminder_enable": false,
  "callback_url": "https://yoursite.com/payment-success",
  "callback_method": "get"
}

Set notify.sms and notify.email to false if you are sending the link manually via WhatsApp, so the customer does not receive a duplicate notification from Razorpay. Map {{order_id}}, {{customer_name}}, etc. from your flow.

Step 3: Send the payment link on WhatsApp

The response from the payment links endpoint contains a short_url field. That is the URL to send to the customer.

Response (key fields)
{
  "id": "plink_ExjpAYRITq5Sm6",
  "short_url": "https://rzp.io/i/nxrHnLJ",
  "status": "created",
  "amount": 50000,
  "currency": "INR"
}

Map short_url from the response into the next WhatsApp message step. The message might read: 'Your payment link for Rs 500 is ready. Please pay here: {{payment_link}}'. The customer taps it and completes payment on Razorpay's hosted page.

Worked example: collecting a deposit over WhatsApp

A customer books a service through your WhatsApp chatbot. The bot captures the booking details and the amount, then calls the Razorpay step to create a link for the deposit amount.

Body for a deposit payment link
{
  "amount": {{deposit_amount_paise}},
  "currency": "INR",
  "description": "Deposit for {{service_name}} booking",
  "customer": {
    "name": "{{customer_name}}",
    "contact": "91{{customer_phone}}"
  },
  "notify": {
    "sms": false,
    "email": false
  },
  "expire_by": {{expiry_timestamp}},
  "reminder_enable": true
}

The bot then sends: 'Great! Here is your deposit link for {{service_name}}: {{short_url}}. Please pay within 24 hours to confirm your booking.' Once the customer pays, Razorpay triggers your callback URL and the flow can send a confirmation message.

Troubleshooting

SymptomLikely causeFix
401 UnauthorizedWrong keys or incorrect Basic Auth encodingRe-check Key ID and Key Secret; confirm you are using the correct mode (test vs live)
Amount too small errorAmount below Razorpay's minimum (usually Rs 1)Ensure amount is in paise and is at least 100 (Rs 1)
422 UnprocessableInvalid phone number format in customer.contactIndian mobile numbers should include the country code: 91XXXXXXXXXX
Link not openingTest key in use but trying with production link checkerNormal; test links only work in Razorpay test mode
Payment confirmation not arrivingNo callback URL set or URL not publicly reachableSet callback_url to a public endpoint; localhost will not work

Razorpay returns detailed error messages in the error field of the response JSON.

Common questions

Where do I get my Razorpay API keys?
+
Log in to your Razorpay Dashboard at dashboard.razorpay.com. Go to Settings, then API Keys. Generate separate keys for Test and Live modes. You receive a Key ID and a Key Secret. Copy both immediately since the secret is not shown again after you close the window.
What is Basic Auth and how does it work for Razorpay?
+
Basic Auth is a standard HTTP authentication method. For Razorpay, you combine your Key ID and Key Secret with a colon between them (key_id:key_secret), then base64-encode that string. The result goes in the Authorization header as Basic followed by the encoded string. The External API Request step's Basic Auth setting handles this automatically when you enter your Key ID as the username and Key Secret as the password.
What is the difference between a payment link and a payment order in Razorpay?
+
A payment link is a URL you can share with a customer that opens a hosted Razorpay checkout page. This is the easiest thing to send inside a WhatsApp message, since the customer just taps the link. A payment order is a more technical construct you create before a checkout session; it is used when you are embedding Razorpay's checkout into your own website. For WhatsApp, payment links are the right choice.
What does the short_url in the response contain?
+
The short_url field in the response to a payment link creation is the URL you send to the customer on WhatsApp. It is a hosted Razorpay page where the customer can pay using UPI, cards, net banking, or wallets. Once the customer pays, Razorpay sends a webhook to your callback URL confirming the payment.
Does this cost anything on WA.Expert?
+
WA.Expert does not charge extra for using the External API Request step beyond it being a standard automation action. The WhatsApp message containing the payment link is free if sent inside an active 24-hour service window. Razorpay charges a transaction fee on each payment, which they deduct from the settlement amount.
How do I know when the customer has paid?
+
Set a notify_url (webhook URL) in the payment link body. Razorpay sends a POST request to that URL when the payment is completed. You can then trigger a follow-up WhatsApp message thanking the customer and confirming the payment, using another automation step that listens for that webhook.
Related

Keep building

Close every payment inside the WhatsApp conversation.

Free trial, no credit card required. And if you ever get stuck, we are the only platform in India that answers you live on WhatsApp.

Start Free →Book Demo
1