UPI Integration

This page explains how you can integrate the UPI payment source in your custom checkout solution to instantly collect the total amount payable from your customer with a single identifier i.e. UPI ID or VPA. Users can conveniently use their VPA to make a secure and immediate payment without entering any bank or card details and without using multiple apps (merchant, SMS, UPI app) for payments.

Paytm offers two UPI flow to collect payment on your checkout page:

  • UPI Intent
  • UPI Collect

Note: If a user wants to make a payment using the UPI payment source, it is mandatory to have the UPI apps installed on their mobile device.

UPI Intent

The UPI Intent flow to collect payment works on mobile browsers/applications with the use of UPI supported apps installed on a user’s mobile device that makes the payment process for them a lot smoother. Its Improved and seamless payment process results in an optimal user experience for your customers by avoiding the switching between multiple apps (merchant, SMS, UPI app) for payments.

To see the complete integration flow for UPI Intent, click here.

UPI Collect

The UPI Collect flow is a UPI payment process which allows you to collect payments by prompting the user to enter just the Virtual Payment Address (VPA) on the checkout page of your website/app. User is notified through SMS and is prompted to make the payment on the relevant bank App. The detailed integration steps for UPI Collect are explained below.

Demo of UPI Collect Flow

Integration Steps of UPI Collect Flow

This section explains the integration steps to process payment through UPI Collect flow. Make sure you have followed the Pre-requisites and Integration Steps mentioned on the Paytm Custom Checkout page.

  1. User selects BHIM UPI as the payment source on your checkout page and enters the VPA through which it intends to make the payment.
  2. You call the Validate VPA API to validate the VPA.
  3. User clicks the Pay button and then you call the Process Transaction API, where you pass UPI as a paymode in the request to select the UPI Collect flow.

    Note: You can hit the Process Transaction API either through Form post or JSON based.

  1. You hit the Process Transaction API as an HTML form post through the client and then Paytm processes the transaction. In response, a polling screen is shown to the user with a session expiry timer and a message that the UPI collect request has been sent to the user on the registered VPA. The user also receives a push notification on the UPI app and/or SMS on their mobile number registered with UPI app, inferring that a UPI Collect request has been sent to them. Please refer to the Process Transaction API sample request/response below:
    <form method="post" type="redirect" action="">
        <input type="text" name="mid" /> value="INTEGR7769XXXXXX9383" 
        <input type="text" name="orderId" /> value="ORDERID_98765" 
        <input type="text" name="txnToken" /> value="f0bed899539742309eebd8XXXX7edcf61588842333227"
        <input type="text" name="paymentMode" /> value="UPI" 
        <input type="text" name="payerAccount" /> value="7777777777@paytm"
        <input type="submit">
  2. User accepts the collect request either through the push notification sent over the UPI app or the SMS and completes the payment on the PSP app.
  3. On successful payment, the user gets the payment confirmation on their UPI app.
  4. User goes back to the polling screen and after successful payment, the polling screen is redirected to the Callback URL.
  5. You receive the transaction status on the Callback URL. Please refer to the sample response here.
  6. Prior to verifying the payment, you must validate the checksumhash received in response to the Process Transaction API. To verify it, use the Paytm library with all the parameters in key-value pairs on the merchant server.
  7. Validate the transaction response via server-side request using the Transaction Status API. You must verify the order Id and amount with your DB entries and consider the status as the final status of the transaction in all cases.
  8. After the transaction status verification, you show final payment status to the user.

Post integration steps

Post completion of integration in your staging environment, it is mandatory to test the Paytm payment sources integration on your website/app before moving into the live environment with production account details (received from Paytm team)

  1. You can view the staging transaction details in the “Test Data” mode on your dashboard.
  2. You must ensure to re-verify the transaction response with Transaction Status API via server to server call for payment flow and not as a one-time activity.

Post successful testing in your staging environment, move your code to the live environment with production account details. These credentials will be available after you activate your business account with Paytm on the Merchant Dashboard.

Paytm recommends you to read about Managing Refunds and late payment notifications for a better understanding of the integration.

For any issues with the integration, refer to Get in touch.