search

Auto Debit

Auto-debit offers a one-click payment experience for your website or mobile app enabling payments via Paytm Wallet, Paytm Postpaid and your gift vouchers issued by Paytm. Your customers need to once authorize and link their Paytm account with your application and later enjoy superfast checkout every time.

Note: Paytm Auto-Debit is only available to select enterprise customers with high transaction volumes and established businesses. Get in touch to request access to Paytm Auto-Debit payment solution.

Demo of Auto Debit

 

 

Pre-requisites

Before you begin the integration, make sure you follow the steps below:

  1. Create an account on Paytm as a merchant. Click how to create an account. MID and merchant key will be available on the Paytm Dashboard
    1. MID: A unique merchant identifier issued by Paytm for your account
    2. Merchant Key: A unique secret key used to secure encryption of every request. This needs to be kept on the server-side and should not be shared with anyone.
  2. Get your authentication keys (Client ID and Client Secret). It will be shared by the Paytm team.
    1. Client ID: A unique alphanumeric identifier issued by Paytm for your account
    2. Client Secret: A unique alphanumeric key issued by Paytm for your account
  3. Go through the checksum logic to understand how to generate and validate the checksum.
Note: Client Secret and Merchant Key are secret keys used for encryption so never share these with anyone.

Overview of payment processing via Paytm Auto-Debit

  1. User visits your website or mobile application and then you ask the user to link their Paytm account for seamless payments.
  2. You initiate the account linking process using the Send OTP APIValidate OTP API, and Refresh Token API.
  3. Once a user account is successfully linked, Paytm shares the user SSO_TOKEN and refresh_token with you.
  4. SSO_TOKEN comes with a limited validity. Whenever SSO_TOKEN of any user expires, you can use the Refresh Token API and get a new SSO_TOKEN for the user.
  5. User adds goods/services into the shopping/order cart.
  6. You calculate the total order amount and call the Paytm Fetch Instrument API.
  7. Paytm returns all applicable instruments having sufficient balance and active status out of Paytm Wallet, Paytm Postpaid and Merchant Gift Voucher as per customer and merchant combination.
  8. User selects the payment instrument from the listed options and merchant calls the Auto Debit API with the selected instrument to deduct funds.
  9. In case the balance is insufficient in all the payment instruments returned in Fetch Instrument API, you can Invoke Paytm App to complete payment.
  10. Post payment completion, call the Transaction Status API to verify the transaction response.
  11. Notify the payment status to the user and proceed with the order/service fulfilment.

Steps in processing payments via Paytm Auto-Debit

STEP 1: Link a user’s Paytm account with your application

 

Demo of Paytm Account Linking

 

Find the detailed interaction of each system component for Paytm account linking in the flowchart below:

 

 

You can see below the list of APIs and their use cases with respect to the Paytm account linking on merchant app/website.
 

Usecase category API Name Description
Send OTP to entered mobile number Send OTP API This API is used to send an OTP to a user's mobile number so as to start linking of Paytm user’s account on merchant web/app.
Linking of Paytm account Validate OTP API                                          This API is used to verify the OTP entered by the user and provide the required tokens in response.
  • The tokens received (Access and Refresh token) are specific to client Ids provided by Paytm
  • Access token which is also known as SSO token is an identifier for Paytm user account
  • Refresh token has longer validity and is used to retrieve a new SSO token on its expiry
Refresh Paytm user’s SSO token Refresh Token API This API is used to retrieve the new SSO token of the Paytm user account upon its expiry
Validate Paytm user’s SSO token Validate Token API This API is used to validate the Paytm user’s SSO token
De-link Paytm user’s account Revoke Access API This API is used to expire the Paytm user’s SSO token. This is done in the case a user deletes or de-links the account on your application.

 

STEP 2: Fetch available payment instruments

You must ensure that the user has enough balance in the selected instruments from the response of Fetch Instruments API  to pay for an order before initiating the Auto Debit API.

Flow chart to show a detailed process of Paytm app invokes in case of insufficient balance:

 

 

If any of the proprietary payment instruments don’t have sufficient balance then invoke Paytm App for payment.

For example: A user has Rs. 200 in their Paytm Wallet, Rs. 150 in Paytm Postpaid and Rs. 100 in Merchant Gift Voucher. The transaction amount for the order is Rs. 500. In this case, no payment method has sufficient funds hence you need to invoke Paytm App for making payment

 

STEP 3: Debit amount from a user's Paytm account and confirm the transaction

Now that you have ensured that your customer has enough balance to pay for the order, you can debit the amount using the Auto Debit API and confirm the transaction using Transaction Status API.

 

STEP 4: Managing Refunds

If you need to cancel or refund a successful transaction, simply send a Refund API request and ensuring success using the Refund Status API.

On completion of your integration

Post completion of integration on your staging environment, do a complete transaction from order summary page on your website or mobile app

  1. Attempt a test transaction using the Test Paymodes Credentials.

  2. Ensure you re-verify transaction response with Transaction Status API via server to server call in payment flow and not separately as a one-time activity.

  3. See the transaction details in the "Test Data" mode on your dashboard.

Once the test transaction is complete, move your code to live environment with production account details, which you would have received from Paytm.

 

Lastly, it's recommended that you read about Managing Refunds and late payment notifications.

 

In case of any issues with integration, please Get in touch.