Keys / Razorpay
RAZORPAY_KEY_SECRET
The key secret your server pairs with the key ID (RAZORPAY_KEY_ID) to call Razorpay's APIs with Basic Auth. Test and Live mode each have their own.
- Expires
- the docs don't say
- API
- none; Dashboard only
Get it
Create one on dashboard.razorpay.com. The steps aren't recorded yet.
Set it
RAZORPAY_KEY_SECRET=...
Razorpay's Node.js, Python, Go, PHP, Ruby and Java SDKs don't read it; your app passes it in with the key ID. The Razorpay CLI and MCP server read RAZORPAY_KEY_SECRET. Or keep it out of .env with keypin: keypin run -- npm run dev
Replace it
- In the Dashboard, pick Test or Live mode, then go to Account & Settings > API Keys > Generate new key. Choose to deactivate the old key within 24 hours, not immediately.
- Download the new key ID and secret. The Dashboard shows only the key ID afterward.
- Deploy both everywhere that reads
RAZORPAY_KEY_IDandRAZORPAY_KEY_SECRETbefore the 24 hours end. Check that nothing still uses the old key; it stops working then.
Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.