1. Build Integration

Steps to integrate your WHMCS website with Razorpay Payment Gateway.


Follow the steps given below to integrate Razorpay Payment Gateway with your WHMCS website.

  1. Ensure you have the latest version of WHMCS installed.
  2. Download the Source code zip file of the required version of the plugin from the Releases section in GitHub.
    1. If you are using WHMCS 5, download the release tagged .
    2. If you are using WHMCS 6, 7 or 8, download the release tagged .
  3. Unzip and upload the contents of the repository to your WHMCS Installation directory. That is, the contents of the module folder from the repository goes into the module folder of your WHMCS Installation directory.
  4. Log in to your site as the WHMCS administrator. This is done by adding /admin to the URL where you have installed WHMCS, for example, www.example.com/whmcs/admin.
  5. Navigate to SetupPaymentsPayment Gateways.
  6. Select Razorpay from the drop-down list and Activate it.
  7. Enter the [KEY_ID] and [KEY_SECRET]. You can generate these from your .
  8. Set Convert for Processing to INR if your store has a different default currency. In this case, ensure that you update the Exchange Rate in your currency management settings.
  9. Click Save Changes.

To receive webhook notifications, you should configure webhooks on your WHMCS site and the Razorpay Dashboard.

To set up webhooks in the WHMCS site:

  1. Log in to your site as the WHMCS administrator.
  2. Navigate to System SettingsPayment Gateways.
  3. Click Manage Existing Gateways.
  4. Select the Enable Webhook option.
  5. Copy the URL that appears on screen. In the Razorpay Dashboard, configure this URL in SettingsWebhooks. Know more about how to .
  6. Enter the secret.
Setting up Webhooks on WHMCS site

To set up webhooks in the Razorpay Dashboard:

  1. Log in to the Razorpay Dashboard.
  2. Navigate to SettingsWebhooks.
  3. Click + Add New Webhook.
  4. In the Webhook Setup modal:
    • Paste the URL copied from the WHMCS site.

      Handy Tips

      Webhooks can only be delivered to public URLs. If you attempt to save a localhost endpoint as part of a webhook setup, you will notice an error. Know about

      .

    • Enter the Secret you had provided on the WHMCS site. The secret is used to validate that the webhook is from Razorpay. Do not expose the secret publicly. Know about how to

      .

    • In the Alert Email field, enter the email address to which notifications must be sent in case of webhook failure.

    • Select the order.paid event from the list of Active Events.

  5. Click Create Webhook.
Setting up Webhooks on Razorpay Dashboard

You can track the payment status in three ways:

Handy Tips

  • On the Dashboard, ensure that the payment status is captured. Refer to the payment capture settings page to know how to .
  • Subscribe to our webhooks or poll the Fetch a Payment API to track the payment status.

To verify the payment status from the Dashboard:

  1. Log in to the and navigate to TransactionsPayments.
  2. Check if a Payment Id has been generated and note the status. In case of a successful payment, the status is marked as Captured.
Check if the payment id is generated and the status is captured

You can use Razorpay webhooks to configure and receive notifications when a specific event occurs. When one of these events is triggered, we send an HTTP POST payload in JSON to the webhook's configured URL. Know how to

If you have subscribed to the order.paid webhook event, you will receive a notification every time a customer pays you for an order.

to check the payment status.


Is this integration guide useful?