B6AIDocs

Connect Razorpay to B6AI

Set up the Razorpay integration end to end, from creating credentials in Razorpay to verifying the live connection and using it in your bots.

8 min read

Overview

The Razorpay integration lets bots collect payments inside a conversation, create a payment link or order, then confirm the payment automatically via webhook.

It’s ideal for taking bookings, deposits and one-off charges without sending the customer to a separate flow.

What you will need
A Razorpay account with administrator access, and a B6AI user with the Enterprise Admin role, integrations are configured once at the workspace level and shared by every bot.

What you can do with Razorpay

Once connected, your bots and agents can use Razorpay inside conversations and automations. Typical uses include:

  1. Create an order or payment link and share it in chat.
  2. Confirm payment status in real time via webhooks.
  3. Read a payment’s history and status on request.
  4. Issue refunds from a conversation (where enabled for your account).

How the integration works

B6AI calls the Razorpay API using your Key ID and Key Secret (Basic auth), and verifies incoming events with a webhook secret (HMAC signature) so it can trust payment confirmations.

Always build and test with test-mode keys first, then switch to live keys once you’re confident.

Prerequisites

Make sure all of the following are in place before you start. Each one is required, skipping any will cause the connection to fail later.

  1. A Razorpay account (test mode works immediately; live mode requires KYC activation).
  2. Permission to generate API keys and add webhooks.
  3. The Enterprise Admin role in B6AI.

Create or prepare your Razorpay account

If your organization does not already use Razorpay, create an account first. Existing customers can skip to the next step.

  1. Sign up at razorpay.com.
  2. For live payments, complete KYC activation. Test mode is available right away.

Choose a connection method

B6AI supports more than one way to connect Razorpay. Pick the one that fits your organization’s policies, the rest of this guide works for either.

MethodWhen to use itNotes
Test keysBuilding and verifying safelyKeys start with rzp_test_… and never move real money.
Live keysProduction paymentsKeys start with rzp_live_… and require KYC activation.

Generate your Razorpay API keys (Key ID & Key Secret)

B6AI authenticates with Razorpay using your Razorpay API keys (Key ID & Key Secret). Follow these steps exactly, each field you copy here is entered into B6AI later.

  1. In the Razorpay Dashboard, choose Test or Live mode using the toggle at the top.
  2. Open Account & Settings → API Keys → Generate Key.
  3. Copy the Key ID (rzp_test_… or rzp_live_…) and the Key Secret, the secret is shown only once.
  4. Open Settings → Webhooks → Add New Webhook, set the URL to the value B6AI shows during connection, select the events below, and copy the webhook secret.
Keep secrets safe
Treat every token, key and secret like a password. Never commit them to source control, paste them into chat, or email them. B6AI stores them encrypted at rest, enter them only in the integration settings.

Required permissions & scopes

Grant only the scopes below. Each one maps to a specific B6AI capability; requesting fewer reduces risk and speeds up any review your Razorpay administrator performs. The table explains exactly what each scope allows and why it is needed.

Scope / permissionWhat it allowsWhy B6AI needs it
Key ID + Key SecretAuthenticate all API callsCreate orders/links and read payment status
Webhook: payment.captured, order.paidReceive payment confirmationsConfirm a payment automatically in the conversation
Webhook: refund.processedReceive refund eventsConfirm refunds you initiate from chat

Finish configuration inside Razorpay

Complete these steps in the Razorpay console before connecting B6AI, so the credentials are fully active.

  1. Enable the webhook and select at least payment.captured and order.paid.
  2. Switch from test to live keys (and update the webhook) only when you’re ready for real payments.

Connect Razorpay in B6AI

Now enter your credentials in B6AI. Signed in as an Enterprise Admin, open Settings → Integrations, find the Razorpay card and click Connect, then complete the form. Every field is explained below.

  1. In B6AI, open Settings → Integrations → Razorpay.
  2. Choose test or live mode to match your keys.
  3. Paste the Key ID, Key Secret and webhook secret.
  4. Click Save: B6AI creates a test order to validate the keys.
json
{
  "provider": "razorpay",
  "key_id": "rzp_test_…",
  "key_secret": "…",
  "webhook_secret": "…",
  "mode": "test",
  "currency": "INR"
}
FieldWhat it isExample value
Key IDYour public API keyrzp_test_1A2b3C…
Key SecretYour secret API key9zYx…
Webhook secretVerifies event signatureswhsec_…
Modetest or live (must match the keys)test
CurrencyDefault order currencyINR

Verify the connection

Confirm the integration is live before you rely on it in a bot.

  1. Confirm the Razorpay card shows “Connected”.
  2. Run the test: it creates a test order.
  3. Complete a payment using Razorpay’s test cards and confirm the webhook marks the order paid.
Connected
A green “Connected” status plus a successful test confirms Razorpay is ready to use in your bots, action nodes and automations.

Troubleshooting

If the connection fails or an action does not work, match the symptom below to its cause and fix.

Symptom / errorLikely causeHow to fix it
authentication error (BAD_REQUEST_ERROR)Wrong Key ID/Secret, or mode mismatchRe-copy the keys; make sure test/live mode matches the keys
Signature verification failedWrong webhook secretRe-copy the webhook secret from the dashboard
Payment not capturedAuto-capture is offEnable auto-capture, or capture the payment in the flow
Refund failedInsufficient balance or refunds not enabledFund the account or enable refunds for your account

Limitations & rate limits

Keep these constraints in mind so your bots behave predictably at scale.

  1. Live mode requires completed KYC.
  2. Refund availability and supported currencies depend on your account.
  3. API rate limits apply; every event signature is verified before it’s trusted.
Rate limits
Razorpay applies API rate limits; B6AI retries transient failures and verifies the signature on every webhook event.

Security best practices

  1. Grant only the scopes and permissions listed above, never request more “just in case”.
  2. Rotate your Razorpay API keys (Key ID & Key Secret) on a regular schedule, and immediately if you suspect exposure.
  3. Restrict the Enterprise Admin role (which manages integrations) to a small, trusted group.
  4. Prefer a dedicated service account or bot user over a personal login, so access survives staff changes.
  5. Review the integration’s activity in the B6AI Activity Logs periodically for unexpected calls.
  6. Disconnect the integration the moment a credential leaks; then rotate it in Razorpay before reconnecting.

Recommendations

  1. Test against a sandbox or non-production Razorpay account before connecting live data.
  2. Document which bots and flows depend on this integration so changes are predictable.
  3. Set a recurring reminder to review scopes and rotate credentials.
  4. Enable only the capabilities you actually use today; you can widen scopes later.
Was this page helpful?