API ReferenceIntegrationsKnowledge Base

Test OAuth Flow

Creating a sample application allows you to test the entire Razorpay OAuth flow in order to securely obtain access to merchant's data. In this document, we demonstrate the integration steps by granting access to your application for your own account.

Create a Test Application🔗

To create a test application you need to have an OAuth access on your Razorpay account. To request the OAuth feature, You can get in touch with us at https://razorpay.com/support.

Once you have obtained access, follow the instructions given below to create a test application:

  1. On your Razorpay Dashboard, click Partner.

  2. Click Applications to open the Applications tab. This tab displays a list of created applications.

  3. You can create a new application by clicking Create Application.

  4. In the Create Application screen:

    1. Enter the Name of your application. For example, "Acme Corp". This would appear on Razorpay's authorization page.
    2. Enter the Website URL of the application.
    3. Click Upload App Icon to upload the app's logo. The uploaded icon will be shown to your users on Razorpay Connect screens. The icon will also be displayed in the connected applications list. Note:
      The dashboard only allows square images to be uploaded as App Icon.

    1. Click Save.

    This will create an application on your Razorpay account, which will appear on the list of created applications. An Edit Application page will show the application settings for both Development and Production clients.

    Client ID and Client Secret are predefined for both Development and Production clients. Use them to make request calls to Razorpay servers.

  1. Enter the Redirect URIs in comma-separated format. For Production client:
    Only URLs with https are supported. For example, https://acmecorp.com.

  2. Click Save.

  3. Click Preview OAuth Page. This will redirect you to the authorization page where you can authorize or decline access to your test application for your account. Post setup, you can request access to the merchant account/data for your application in the same manner.

    Note:
    For development clients, we support https://localhost as a redirect_uri on Preview. You can; however, replace it with any of the valid URLs as specified in the Development client settings and reload the page.

  4. Click Authorize. This will redirect you to the redirect_uri sent in the request URL along with the auth code.

  5. Copy the auth code from the URL and use it to obtain the new access token.

    Note:
    While making the API request, pass mode=test. This will fetch you an access token for the test mode. Although the default is Live mode, testing with live token would not help much unless your account is activated.

    For both production and development clients, you can control the accessibilty of the application using the scope parameter. A read_write (scope=read_write) access would grant edit access to the application while read_only (scope=read_only) would allow only view access.

Your test application will appear on the list of Connected Applications on the merchant's Dashboard.

Revoke Access🔗

Revoking access to a particular application would restrict all permissions to access merchant data and thereby remove it from the list of Connected Applications.

To revoke access to a connected application, click Revoke beside the application.

Test Webhooks🔗

You can test webhooks for specific event on your test application.

To test webhooks for your created sample application, follow the below steps:

  1. On your Razorpay Dashboard, navigate to Settings > Applications.

  2. Click Applications.

  3. On the Edit Application page, click Manage Webhook.

  4. Generate a unique test endpoint for webhooks.

  5. Enter the generated URL in the Webhook URL field. The webhook payload will be POSTed to the same URL.

Note:
Ensure that you monitor the webhook URL to see the Razorpay webhooks in action.

×