Skip to main content

1. Access Payment APIs using OAuth

You can process payments on behalf of your sub-merchants using Razorpay APIs. Use the tokens generated during OAuth integration. Use the access_token generated in the build integration step to authenticate using Bearer Auth. Below is a sample code to create an Order and process payments. /orders
Request
The parameter descriptions and errors are present in the Create an Order API documentation.

2. Public Token

Using the public_token for authorisation can secure a public-facing implementation such as Razorpay Checkout. In such cases, the public_token can replace the key_id field as shown below:
Checkout
Know more about Web Standard Integration.

3. Verify Payment Signature

This is a mandatory step to confirm the authenticity of the details returned to the Checkout form for successful payments. To verify the razorpay_signature returned to you by the Checkout form:
  1. Create a signature in your server using the following attributes:
    • order_id: Retrieve the order_id from your server. Do not use the razorpay_order_id returned by Checkout.
    • razorpay_payment_id: Returned by Checkout.
    • client_secret: Available in your server. The client_secret that was generated from the RazorpayDashboard.
  2. Use the SHA256 algorithm, the razorpay_payment_id and the order_id to construct a HMAC hex digest as shown below:
    HMAC Hex Digest
  3. If the signature you generate on your server matches the razorpay_signature returned to you by the Checkout form, the payment received is from an authentic source.

Generate Signature on Your Server

Given below is the sample code for payment signature verification:
Java

Post Signature Verification

With this, your integration is complete. Test the integration before going live. Replace the test key with the live key and integrate with other APIs.

List of Available Payment Products

Below is a list of Razorpay products available to you to accept payments.

Product and Use

Payment Gateway: Integrate our Payment Gateway with your website or app to accept payments from customers.

Magic Checkout: Integrate Razorpay Magic Checkout to help customers complete prepaid and cash-on-delivery (COD) transactions on your website/app and reduce your COD RTOs.

Invoices: Create and send GST-compliant invoices that your customers can pay online instantly. Get paid faster and improve your cash flow.

Subscriptions: Offer your customers subscription plans with automated recurring transactions on various payment modes.

Smart Collect: Generate virtual bank accounts and UPI IDs on demand and accept payments using NEFT, RTGS, IMPS and UPI. Get notified for each incoming payment and automate the tedious reconciliation process.