Skip to main content
Razorpay lets you accept payments on your website or mobile app with a few lines of code. This guide walks you through creating an account, generating API keys, integrating Standard Checkout on the frontend, and verifying payments on your server.
Razorpay has two modes: Test Mode and Live Mode. Test Mode is available immediately after signup — no KYC required. API keys in Test Mode start with rzp_test_ and process no real money. Live Mode requires KYC approval (typically 24–48 hours) and uses keys starting with rzp_live_.
1

Create an account and generate API keys

Sign up at the Razorpay Dashboard. Once logged in, navigate to Account & Settings → API Keys and click Generate Key.Razorpay generates a Key ID and a Key Secret together. Copy and store the Key Secret immediately — it is only shown once at the time of generation.You can start building in Test Mode right away. To accept real payments, complete KYC from the Dashboard and wait for approval.
2

Create an order (server-side)

Before showing the payment form to your customer, create an order on your server using the Razorpay SDK. The order ID ties the payment to your backend and is required for signature verification.Install the Node.js SDK:
Then create an order:
Pass the order.id from your server to your frontend to use in the next step.
3

Integrate Standard Checkout (frontend)

Add the Razorpay Checkout script to your HTML and open the payment form using the order ID you created in the previous step.
The handler function runs after a successful payment. It receives a razorpay_payment_id, razorpay_order_id, and razorpay_signature — send all three to your server to verify the payment.
4

Verify payment signature (server-side)

Always verify the payment signature on your server before fulfilling an order. This confirms the payment response was not tampered with.
Only fulfill the order if isValid is true. Reject or flag any payment where signature verification fails.
5

Test and go live

Use Razorpay’s test card numbers to simulate payments in Test Mode before going live.
Use test card number 4111 1111 1111 1111 with any future expiry date and any 3-digit CVV to simulate a successful payment. Razorpay provides additional test cards for declined payments and UPI flows in the Dashboard test credentials section.
When you are ready to accept real payments:
  1. Complete KYC from Account & Settings in the Dashboard. Approval typically takes 24–48 hours.
  2. Generate a new set of Live Mode API keys (starting with rzp_live_).
  3. Replace your rzp_test_ Key ID and Key Secret with the live equivalents in both your server and frontend code.
  4. Test a small real transaction to confirm end-to-end flow before announcing to customers.