All articles
Payments20 November 20264 min read

How to Connect Razorpay to Checkout DM: Keys and Webhook

Connecting Razorpay needs three values: a Key ID, a Key Secret and a Webhook Secret. Here is where each one lives and which events to subscribe to.

PJ
Prince Jindal

Founder, Checkout DM

Razorpay Key ID, Key Secret and Webhook Secret fields ready to paste into Checkout DM

To take payments in your Instagram DMs through Razorpay, Checkout DM needs three things from your Razorpay Dashboard: a Key ID, a Key Secret and a Webhook Secret. The first two let Checkout DM create payment links for you. The third lets it confirm that a payment notification really came from Razorpay. This guide shows where each one lives.

What each value does

ValueWhere it comes fromWhat it does
Key ID and Key SecretRazorpay Dashboard, Account and Settings, API keysAuthenticate every payment request Checkout DM sends on your behalf
Webhook SecretA secret you type yourself when you add the webhook in RazorpayLets Checkout DM verify that a payment notification really came from Razorpay

Step 1: Key ID and Key Secret

  1. Log in to the Razorpay Dashboard with your business account.
  2. Choose Test Mode or Live Mode with the toggle near the top. Test keys are for trying things out with fake payments, and Live keys are for real customers. Each mode has its own separate Key ID, Key Secret and Webhook Secret, so do not mix them up.
  3. Open Account and Settings, then API keys, under the Website and app settings card.
  4. Generate your keys. If you have not generated keys before, click Generate Key. Razorpay shows the Key ID and Key Secret together, with a Download button. Save both now.

If you have lost the Secret, you will need to click Regenerate Key. That creates a brand-new pair, and the old Key ID and Secret stop working immediately, so update them everywhere they were in use, including Checkout DM.

Step 2: the webhook and its secret

A webhook is how Razorpay tells Checkout DM, in real time, that a payment succeeded or failed. Setting one up takes four steps.

  1. Open Settings, then Webhooks in Razorpay and click Add New Webhook.
  2. Paste the webhook URL. The URL is the same for every Checkout DM merchant and is shown in Checkout DM’s Razorpay keys guide, so copy it from there.
  3. Type your own secret. Razorpay does not generate this one for you. Use a long, random string. Whatever you type is the exact value you will paste into Checkout DM’s Razorpay Webhook Secret field, and the two must match exactly or Checkout DM cannot verify incoming webhooks.
  4. Choose events and save. Tick the events described below, click Save Webhook, and reopen it from your Webhooks list any time to check the URL, the enabled events or the secret.

Which events to subscribe to

  • payment.captured: the payment went through and the money is captured. This is the main event Checkout DM uses to mark an order as paid.
  • payment.failed: the payment attempt failed. Checkout DM uses it to let the customer know and, where possible, prompt a retry.
  • payment.authorized: the bank authorised the payment but it is not yet captured. Useful for catching payments confirmed a little later than usual.
  • order.paid: fires once an order is fully paid, tying the payment back to the order it belongs to.

At minimum, Checkout DM needs payment.captured and payment.failed. It is also worth ticking payment.authorized and order.paid if you see them, because they cover edge cases such as delayed bank confirmations.

Step 3: paste everything into Checkout DM

Paste your Key ID, Key Secret and Webhook Secret into the Razorpay section of your Payment Settings in Checkout DM. Nothing is charged until it is saved and verified. Start in Test Mode with a test order to be sure the pieces work, then repeat with your Live keys and Live webhook when you are ready for real customers.

If something goes wrong

If Checkout DM cannot create a payment link for an order, the order shows the status link failed in your Orders tab and the customer cannot pay until it is fixed. Check that the Key ID and Key Secret were copied exactly and come from the same mode, Test or Live, as the webhook you set up. Our status badges guide lists every order status.

Razorpay is one way to get paid in DMs. If you are choosing between a payment gateway and a UPI QR code or UPI ID, our guide to accepting payments on Instagram: UPI versus a gateway compares them, and how to take payments on Instagram in India covers the wider picture.

Frequently asked questions

What do I need from Razorpay to connect it?

A Key ID, a Key Secret and a Webhook Secret.

Where do I find the Key Secret again if I lost it?

Razorpay only shows it once. You need to click Regenerate Key, which creates a new pair and stops the old one from working immediately.

Where does the Webhook Secret come from?

You type it yourself when you create the webhook in Razorpay. Use a long random string, and paste the exact same value into Checkout DM.

Which webhook events does Checkout DM need?

At minimum payment.captured and payment.failed. Ticking payment.authorized and order.paid as well is recommended to cover delayed confirmations.

Where do I paste the three values?

Into the Razorpay section of your Payment Settings in Checkout DM. Nothing is charged until it is saved and verified.

Can I use Test and Live keys together?

Each mode has its own Key ID, Key Secret and Webhook Secret, so keep them paired. Test with Test Mode first, then switch everything to Live.

Share this article

PJ

Prince Jindal

Founder of Checkout DM, building DM-based checkout for Instagram sellers. He also shares AI automation tutorials on Instagram and YouTube.

Keep reading

🍪We use cookies to run your dashboard and, if you allow it, to improve CheckoutDM. Privacy Policy