Docs Billing

Set up payments

Connect Razorpay for top-ups and plans (admins).

  1. 1

    Create API keys

    In the Razorpay dashboard, create a key pair. Never paste secrets into chat, issues or code.
  2. 2

    Register your website

    In Account & Settings, add the website where payments happen. Razorpay blocks payments from sites that are not registered.
  3. 3

    Add server variables

    Set RAZORPAY_KEY_ID and RAZORPAY_KEY_SECRET on your host, then redeploy.
  4. 4

    Add the webhook

    Create a webhook to https://YOUR-SITE/api/public/razorpay-webhook for the events payment.captured and order.paid, with a secret of your choice.
  5. 5

    Set the webhook secret

    Add the same secret as RAZORPAY_WEBHOOK_SECRET and redeploy.
  6. 6

    Test

    Make a Rs 1 payment and confirm it in Credit Usage.

Troubleshooting

MessageFix
Payment blocked as website does not match registered website(s)Add your site in Razorpay under Account & Settings.
Payments are not configured yetThe key id or key secret is missing on the server.
Webhook returns 401The webhook secret in Razorpay and on the server do not match.