Payment gateways

Connect Razorpay to Bebaak

Payment links and “Pay now” buttons on invoices that collect money into your own Razorpay account.

Applies to: Bebaak (app.bebaak.co) — any organisation, including Bebaak itself. Last checked: 5 November 2026.

Provider menus change from time to time; if a name below differs slightly, look for the nearest match. Never e-mail or share your keys — paste them only into Bebaak.

What you get: payment links and “Pay now” buttons on invoices that collect money into your own Razorpay account. Bebaak never holds the money and never sees card details — Razorpay hosts the payment page. When a payment succeeds, Bebaak marks the invoice paid and records the receipt in Books. You can also check a payment's status and request a refund from Bebaak.

Before you start

  • A Razorpay account for your business (test access is enough to begin).
  • In Bebaak you must be the organisation's admin.
  • Keep Razorpay in test mode until the check in step 7 passes (the Test Mode / Live Mode switch at the top of the dashboard).

Steps

  1. Open the wizard in Bebaak. Settings → Integrations, choose Razorpay under Payments and start the wizard. The status shows “Not connected”.
  2. Get the keys from Razorpay. Sign in at dashboard.razorpay.com. Account & Settings → API Keys → Generate Key (in Test Mode first). Copy the Key ID (starts with rzp_test_) and the Key Secret — the secret is shown only once.
  3. Paste the keys in Bebaak (step 2 of the wizard) and leave Test mode ticked:
Field in BebaakWhat to paste
Key ID (rzp_test_… / rzp_live_…)Key ID
Key secretKey Secret
Webhook secretthe secret you type when you add the webhook (step 6)
  1. Press Save. Status becomes “Keys saved — not tested”. Keys are stored encrypted and are never shown again.
  2. Press Test connection. Bebaak makes one real, read-only call to Razorpay. Only if it succeeds does the status become “Connected (test passed)”.
  3. Webhook (so payments show as paid automatically): copy the Webhook URL shown in the wizard. In Razorpay: Account & Settings → Webhooks → Add New Webhook. Paste Bebaak's webhook URL, type a long random secret (and paste the same text in Bebaak's “Webhook secret”), and tick: payment_link.paid, payment_link.partially_paid, payment.failed.
  4. Test-mode check: create a small payment request in Bebaak (Banking → Payment links, or “Pay now” on a test invoice) and pay it with test details. Use Razorpay's test cards / test UPI shown in their documentation; no money moves in Test Mode. Within a minute the request should show Paid, and Settings → Integrations → Health & log should show the calls as OK.

Go-live checklist

  • Complete Razorpay's activation (KYC, website / business details). Generate live keys in Live Mode, replace the test keys in Bebaak, untick “Test mode”, add the webhook again in Live Mode (webhooks are separate for test and live).
  • Press Test connection again — it must pass in live mode.
  • Make one small real payment (for example ₹1–₹10) and refund it from Bebaak to see the full cycle.
  • Only then share payment links with customers.

Refunds and status

  • On a paid request, Check status reads the payment from Razorpay (it does not change anything).
  • Refund (admin only) asks Razorpay to return all or part of the amount; Bebaak refuses more than what is left unrefunded. Refunds are taken from your Razorpay balance; Razorpay returns the money to the payer's card / UPI / bank (usually 5–7 working days on their side).
  • Record the refund in Books (Payments → refund) so the customer's account is right — the gateway moves the money, Books keeps the accounts.

Troubleshooting

  • “Razorpay refused the keys” — You pasted a live key in test mode (or the other way round), or copied a space. Generate a fresh key and paste again.
  • Payments do not turn “Paid” in Bebaak — The webhook is missing, in the other mode, or its secret differs. Re-add it and paste the same secret in Bebaak.
  • “Webhook signature does not match” in the log — The secrets differ — paste the exact same secret in both places.
  • Anything else: Settings → Integrations → Health & log shows each call, whether it worked, the number of tries (Bebaak retries a call up to 3 times if the provider is briefly unavailable) and the provider's message. Keys are never written to the log.

Security notes

  • Keys are entered only by you in Bebaak and stored encrypted; Bebaak staff cannot read them back.
  • Webhooks are accepted only with a valid signature (or, for PhonePe, a valid X-VERIFY), and repeats are ignored.
  • To stop using Razorpay: Settings → Integrations → Razorpay → Disconnect (keys are deleted; payment links stop using it).

Stuck on a step?

Settings → Integrations → Health & log shows every call and the provider's message. Or ask us.