Connect Razorpay and Avox can send a payment link in a WhatsApp chat, check whether it was paid, refund
a payment and hear about payments the moment they happen. Customers pay with whatever your Razorpay
account offers, such as UPI, cards and netbanking. The money goes straight to your own Razorpay
account; Avox never holds it. This page covers everything from connecting to disconnecting,
including what Avox does when Razorpay is slow, down or says no.
A Razorpay account and someone in it who can create an API key. A live key takes real payments; a test
key is for trying things out.
A plan with room for another connected app, and the Manage connected apps permission in
Settings > Switchboard (Admins have it; an Admin can give it to a Manager).
In the Razorpay Dashboard open Account & Settings, then API Keys, and generate a key. Copy the
Key ID (it starts with rzp_live_ or rzp_test_) and the Key secret. Razorpay shows the secret
once, so copy it before you leave.
2
Open Razorpay in Apps
In Avox open Apps in the sidebar (under Connect & Monitor), then Razorpay, click Connect,
read What Avox can do and click Continue.
3
Paste the keys
Fill in Key ID and Key secret, and click Connect. Webhook secret is optional here and can
be added later.
4
Avox checks the keys
Avox tries the keys with Razorpay before saving them. The check gives up after 10 seconds. If Razorpay
refuses them you see AVX-3686 and nothing is saved. Otherwise you see
Razorpay is connected, and the keys are stored encrypted and never shown again, not even to you.
On Razorpay's Overview in Avox, under Instant updates, copy Avox's address for Razorpay.
Keep it private: it belongs to your Switchboard only.
In Razorpay open Webhooks, add a webhook with that address and a secret of your own, and tick
payment_link.paid, payment_link.cancelled, payment_link.expired and refund.processed.
In Avox click Add next to Webhook secret and paste the same secret.
Without the secret, Avox shows AVX-3709 and refuses the updates, because it
cannot check they came from Razorpay.
Razorpay has its own menu under Apps: Overview, Payments and Activity (tabs along the
top on a phone).
Overview: the status, your account and its mode (Live or Test), who connected it, when it last
worked, the last problem with its code, and what uses Razorpay. Test connection, Reconnect
and Disconnect are here too.
Payments has two lists. Sent by Avox is every payment link Avox sent, with the automation that
sent it and the chat it was for. In Razorpay is every payment on your account, 20 at a time with
Load more. Statuses are Paid, Pending, Partly paid, Failed, Refunded, Partly refunded,
Expired and Cancelled.
Open a payment for its details, then Copy payment link, Open payment link,
Open in Razorpay, Check status now, Refund (you type the amount again to confirm,
AVX-3723) and Cancel link while it is unpaid. Refund, cancel and check
need the Manage connected apps permission.
Activity: Usage (calls a day over 7, 30 or 90 days, success rate, average time) and the
Log with Calls and Webhooks tabs. Click an entry for what Avox asked and what came back.
The connection status is Connected, Needs reconnecting, Having trouble or Disconnected.
Test connection asks Razorpay for one payment and says whether the key is accepted and in which mode.
Payment links come from an automation. In the builder add the step Use a connected app, choose
Create a payment link, pick Razorpay (or another payments app you connected) and fill in:
Detail
Notes
Amount
Required. Type it the way you write it, like 499 or 499.50, or a value like {{item.price}}.
Currency
Required. 3 letters, like INR.
What it's for
Required. Up to 200 characters; the customer sees it.
Your reference
Optional. Up to 40 letters, numbers, - and _.
Customer name, email, phone
Optional.
Link works for
Optional, in minutes: from 30 minutes to 30 days.
The step's values, like {{payment.url}}, can go in the next message. An automation can also start
when a customer submits a Flow, and its steps can use the customer's answers, so a Flow answer can
decide the amount or the description. The Avox library has a premade automation, Payment link after a
booking, that does this with your tables.
Example (hypothetical): a customer books a service. An automation looks up the service's price in your
price table, creates a payment link for it with a reference taken from the booking, and sends a template
message containing {{payment.url}}. When the customer pays, Razorpay tells Avox and the payment shows
as Paid.
Avox tries again only when that is safe. Looking things up is repeated: on a network problem, or
when Razorpay answers busy or unavailable (HTTP 429, 502, 503 or 504), Avox tries up to two more times,
after about 0.4 and then 1.2 seconds, and waits up to 5 seconds if Razorpay says how long. Creating a
payment link, refunding and cancelling are never repeated by Avox, so nothing is made or paid out
twice. If one fails, check the payment in Razorpay before trying again.
The status changes only when it should. If Razorpay refuses the key (regenerated, deleted or
wrong), the status becomes Needs reconnecting at once (AVX-3692; the
log shows AVX-3686). If 5 calls in a row fail on Razorpay's
side (not answering, busy or refusing the request: AVX-3694,
AVX-3695, AVX-3713), it becomes Having trouble. One good
call after that returns it to Connected by itself. A wrong detail, such as an amount Razorpay does
not accept, does not count against its health, and neither does an unticked permission.
The call is logged with the time, action, result, tries and code. Secrets are removed, customer
details masked and links cut down to their address, so the log never holds the data itself.
Automations and Flows keep going. A payment step either Stops the run or Carries on with
the next step, whichever you chose under If it can't be done
(AVX-3605). For a payment link, stopping is usually safer, so the customer
never gets a message without a link. While Razorpay Needs reconnecting, the step does not run and
nothing is sent to Razorpay; the run log shows AVX-3596. If your Switchboard
is paused, Avox does not call Razorpay (AVX-3711) and automations do not
start (AVX-3611). Your Inbox and automations without a payment step are not
affected.
The pages show what Avox saved. If Razorpay cannot be read, Payments shows the links Avox sent
with AVX-3717 and the reason's own code, and refund and cancel wait.
Click Refresh once it is back.
Click Disconnect on the Overview. Avox lists what uses Razorpay (those steps stop until you
connect again, AVX-3708), deletes the keys it saved and keeps the log for your
retention period. Avox does not cancel links you already sent. To be sure the keys cannot be used again,
regenerate the key in Razorpay and delete Avox's webhook there.
A live key takes real payments. A test key is for trying the steps. Reconnect lets you swap one for
the other; Avox treats a new key as the same account.
A payment is paid but Avox still says Pending
Check Instant updates on the Overview: the webhook must use Avox's address, the four events
must be ticked and the secret must match. Meanwhile, open the payment and click Check status now.
Can I refund only part of a payment?
Yes. Click Refund, type the amount, and type it again to confirm. You can refund up to what is left.
Why didn't my customer get an SMS or email from Razorpay?
Avox switches Razorpay's messages off when it makes the link, because the link is sent in the chat.
I regenerated my key in Razorpay
Click Reconnect and paste the new Key ID and Key secret. Leave Webhook secret empty to keep the one saved.