Skip to main content
Standard Checkout for web lets you embed a Razorpay-hosted payment modal on any website using a JavaScript snippet. You create an order on your server, display the checkout to the customer, then verify the payment signature server-side to confirm the transaction.
Standard Checkout is not supported on Internet Explorer. Use a modern browser such as Chrome, Firefox, Safari, or Edge.

Prerequisites

Before you begin:
  • A Razorpay account. Sign up at dashboard.razorpay.com/signup.
  • API Keys (Key ID and Key Secret) generated from your Razorpay Dashboard under Settings → API Keys.
  • A server-side environment capable of making HTTP requests (Node.js, Python, PHP, etc.).

Payment flow

The integration follows three steps:
  1. Your server creates an order and returns the order ID to the client.
  2. The client opens the Razorpay checkout modal using the order ID.
  3. After payment, your server verifies the signature to confirm authenticity.

Integration steps

1

Create an order (server-side)

Before showing checkout to the customer, create an order on your server using the Razorpay Node.js SDK (or any server-side SDK). The amount is in the smallest currency unit — for USD, that means cents; for INR, paise.
server.js
Return order.id to your frontend. You will pass this into the checkout options.
2

Add the Checkout script and open it

Load the Razorpay Checkout script on your page, then configure and open the modal when the customer clicks the payment button. Pass the order_id returned from your server.
checkout.html
The handler function receives razorpay_payment_id, razorpay_order_id, and razorpay_signature. Send all three to your server for verification.
3

Verify the payment signature (server-side)

After the customer completes payment, Razorpay returns a signature. Verify it on your server by recomputing the HMAC-SHA256 hash using your Key Secret. Never skip this step — it is what proves the payment is authentic.
verify.js
If verifyPayment returns true, the payment is genuine and you can fulfil the order. If it returns false, treat the payment as invalid.

Best practices

Set up webhooks as a backup mechanism to capture payments that are authorized after the customer’s browser session ends (for example, due to a network drop). Webhooks are delivered server-to-server and do not depend on the customer’s connection.
  • Always verify signatures server-side. Client-side verification can be tampered with. Signature verification on your server is the only reliable way to confirm a payment.
  • Never expose your Key Secret in client-side code. The Key ID is safe to include in frontend JavaScript; the Key Secret must stay on your server only.
  • Use Test mode during development. Your Dashboard provides separate test API keys. Switch to Live keys only when you are ready to accept real payments.