> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Razorpay with API Key – StackOne Hub

> Link a Razorpay account in the StackOne Hub using API Key. End-user guide to authorize the integration and start using Razorpay actions.

> [!WARNING]
>
> The Key Secret is displayed only once, at the moment the pair is generated. Live keys can capture payments and issue refunds, so store the pair as securely as a password.

## Before you begin

Razorpay issues API keys from the Razorpay Dashboard rather than from the API, and every\
key pair belongs to one mode.

<ul>
  <li>Your Razorpay user must be able to open **Account & Settings** and manage API keys.</li>
  <li>Keys generated in **Test Mode** reach test data only, while live keys move real money.</li>
  <li>Generate the pair in the mode you intend to connect — a key is bound to the mode it was created in.</li>
</ul>

## Generate your API key pair

Razorpay issues the Key ID and the Key Secret together, and shows the secret once.

**1. Sign in to Razorpay**

Sign in to your [Razorpay Dashboard account](https://dashboard.razorpay.com).

<ul>
  <li>Select **Account & Settings** at the bottom of the left sidebar.</li>
  <li>Use the **Test Mode** toggle just above it to switch between test and live data.</li>
</ul>

![The Razorpay Dashboard with Account & Settings highlighted in the left sidebar](https://mintcdn.com/stackone-60/L5lpq8VVHmKH7HI7/connectors/razorpay/images/basic-config-account-settings.png?fit=max\&auto=format\&n=L5lpq8VVHmKH7HI7\&q=85\&s=7a83537032aaa17cfe8a9889f80a6bc2)

**2. Open API keys**

On **Account and product settings**, find the **Website and app settings** card.

<ul>
  <li>Select **API keys** in that card.</li>
</ul>

![The Account and product settings page with the Website and app settings card and the API keys link highlighted](https://mintcdn.com/stackone-60/L5lpq8VVHmKH7HI7/connectors/razorpay/images/basic-config-api-keys.png?fit=max\&auto=format\&n=L5lpq8VVHmKH7HI7\&q=85\&s=70c0110c67c3df125c20410f059be802)

**3. Generate the key pair**

The **Websites & API keys** tab holds the **API keys & integration** section. On an\
account with no key yet, select **Generate Key** to issue the pair.

<ul>
  <li>The panel notes that you can generate API keys after your website is approved, and that you can switch to test mode to get test API keys for integration.</li>
</ul>

![The API keys and integration section with the Generate Key button highlighted on an account that has no key yet](https://mintcdn.com/stackone-60/L5lpq8VVHmKH7HI7/connectors/razorpay/images/basic-config-generate-key.png?fit=max\&auto=format\&n=L5lpq8VVHmKH7HI7\&q=85\&s=170cd55734213edc5b1bca25d32f638e)

**4. Copy the Key ID and Key Secret**

The **New Key ID & Secret** dialog opens immediately, with both halves labeled\
**Test API Key** and **Test Key Secret** while you are in **Test Mode**.

<ul>
  <li>Copy the key id and paste it into the **API Key** field in StackOne Hub.</li>
  <li>Copy the secret and paste it into the **Key Secret** field in StackOne Hub.</li>
  <li>Key ID format: `rzp_test_` for test keys and `rzp_live_` for live keys</li>
  <li>Use **Download** to save both values to a file before you close the dialog.</li>
  <li>The dialog warns that for security reasons, this key can only be downloaded once. If you lose it you will have to regenerate a new one and update it everywhere.</li>
</ul>

![The New Key ID and Secret dialog with the copy controls and the Download button highlighted, key values redacted](https://mintcdn.com/stackone-60/L5lpq8VVHmKH7HI7/connectors/razorpay/images/basic-config-new-key.png?fit=max\&auto=format\&n=L5lpq8VVHmKH7HI7\&q=85\&s=afdc0436e4b1d2c251f30378388e1f3a)

## Regenerate an existing key pair

Once a key exists, Razorpay no longer offers to generate one — the control becomes\
**Regenerate Key**. Use it if the secret was lost or exposed, remembering that the\
replacement supersedes the key in use.

**1. Start the regeneration**

Open the same **API keys & integration** section and select **Regenerate Key**.

<ul>
  <li>The existing key id stays visible on this screen, but its secret cannot be revealed again.</li>
</ul>

![The API keys and integration section on an account that already has a key, with the Regenerate Key button highlighted](https://mintcdn.com/stackone-60/L5lpq8VVHmKH7HI7/connectors/razorpay/images/basic-config-regenerate-key.png?fit=max\&auto=format\&n=L5lpq8VVHmKH7HI7\&q=85\&s=f54cc2833a10a1e900af81e4e6487a23)

**2. Choose when the old key expires**

Razorpay asks **When should old keys expire?** before issuing the replacement.

<ul>
  <li>**Deactivate old key immediately** stops the previous key from working right away.</li>
  <li>**Deactivate old key in 24 hours** leaves a day to update anything still using it.</li>
  <li>Confirm with **Regenerate API key**, then copy the new pair from the **New Key ID & Secret** dialog as above.</li>
  <li>Update the **API Key** and **Key Secret** fields in StackOne Hub with the new values, and store them securely for use later.</li>
</ul>

![The regenerate confirmation dialog with both key expiry options and the Regenerate API key button highlighted](https://mintcdn.com/stackone-60/L5lpq8VVHmKH7HI7/connectors/razorpay/images/basic-config-key-expiry.png?fit=max\&auto=format\&n=L5lpq8VVHmKH7HI7\&q=85\&s=f104a529e59e4e6b854cfe8a8d8772b9)

## Linking the Account from the Hub

**1. Navigate to the Hub**

Use one of the three [Linking Account Methods](https://docs.stackone.com/connect/managing-connectors/linking-accounts.md) to access the Hub.

**2. Fill out the fields**

Fill out the following fields using details from your provider:

<ul>
  <li>**API Key**</li>
  <li>**Key Secret**</li>
</ul>

**3. Connect**

<ul>
  <li>Click **Connect**</li>
  <li>If applicable, the provider will redirect you to a sign-in or authorization page. Complete the provider's authorization flow.</li>
  <li>Once authorization is successful, you will see a confirmation popup</li>
</ul>

If the account linking is successful, you will see the newly linked account on your [Accounts](https://app.stackone.com/accounts) page.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.