search

POSTRenew Subscription API

Use Case

  • To request payment collection for an ongoing subscription. These payment collections are requested with subscription ID provided at the time of creation of subscription
  • In case, the payment collection gets failed from the bank and retry is set on the subscription, retry can also be initiated using this API

Note

  • The success of this API suggests that Paytm has accepted the payment collection request post completion of validations against the created subscription (plan details). This does not mean that money has been deducted from customers account. Once accepted, we initiate the payment collection against the set payment instrument. Upon completion, the same is notified to you on your callback URL
  • Payment collection requests cannot be initiated against expired or cancelled subscriptions
  • Only one payment collection request can be initiated for a subscription in a frequency cycle

Request Attributes

Content Type : JSON

Head

AttributeDescription
clientId
string(3)
optional

Paytm use the merchant key on the basis of clientId parameter value. It requires only if the merchant has more than one key.

Example: C11

version
string(4)
optional

Version of the API.

Example: v1

requestTimestamp
string(15)
optional

EPOCH timestamp of the time at which request is being sent.
Example: 1588402269

channelId
string(3)
optional

The parameter value identifies the Channel for which API call is initiated.

Possible values:
WEB
For websites, the value to be passed should be "WEB"
,
WAP
For Mobile websites/App, the value to be passed should be "WAP"
signature
string(108)
mandatory

Paytm validates the request and ensures that parameters are not tempered by verifying the signature in the request. For creating the checksum (signature) refer to the steps given in Checksum Logic.
Note: Create the signature using the body parameter of the request.

Body

AttributeDescription
mid
string(20)
mandatory

Paytm provides MID as a unique identifier to each merchant. For your staging MID, click here. You get the production MID post the account activation.

Example: INTEGR7769XXXXXX9383

orderId
string(50)
mandatory

The Unique reference ID of the Order. It is alphanumeric and special characters allowed are “@” “-” “_” “.”.
Example: OREDRID_98765

txnAmount
object
mandatory

This parameter is an object and should contain the value of transaction i.e. amount and currency type.
Example: {"value" : "1.00", "currency" : "INR"}

TxnAmount
+
AttributeDescription
value
string
mandatory

This parameter contains the amount to be charged to the customer and can have two places of decimal.
Example: 1.00

currency
string
mandatory

This parameter indicates the currency in which transaction amount is to be deducted.
Possible Values: INR

subscriptionId
string(64)
mandatory

Unique subscription Id generated by Paytm for identifying a subscription.

debitDate
string
optional

Date of debit. Format: YYYY-MM-DD HH:mm:ss
(Only for BANK MANDATE)

Example: 2020-04-20 00:00:00

Response Attributes

Content Type : JSON

Head

AttributeDescription
version
string(2)

Version of the API passed in the request.
Example: v1

responseTimestamp
string(15)

EPOCH timestamp of the time at which response is being sent.
Example: 1588402269

clientId
string(3)

Paytm use the merchant key on the basis of clientId parameter value. It requires only if the merchant has more than one key.

Example: C11

signature
string(108)

You should validate the parameter values by verifying the signature comes in the response. It ensures that parameter values not tempered. Signature string can be verified by using Paytm checksum library.

Body

AttributeDescription
resultInfo
object

This parameter gives the information about the result of the API response

ResultInfo
+
AttributeDescription
resultCode
string

This is the resultCode corresponding to a particular message and is returned to the merchant. It's maximum length is 64. The different result codes corresponding to this API are mentioned below.

resultStatus
string

This parameter indicates the status of API call.

Possible values:
S
For Success
,
F
For Failure
resultMsg
string

This parameter is the result message which contains information about the result. The different result messages corresponding to this API are mentioned below in section " Response Codes and Messages".

txnId
string(64)

This is a unique Paytm transaction ID that is issued by Paytm for each transaction.

Response Codes & Messages

resultCoderesultStatusresultMsg
900SSubscription Txn accepted.
156FPer day Txn amount is crossed for Paytm
158FPer Month Txn amount is crossed for Paytm
165FUser has crossed the monthly debit limit prescribed by RBI
196FPayment failed as amount entered exceeds the allowed limit. Please enter a lower amount and try again or reach out to the merchant for further assistance
202FYour payment is declined by the bank due to insufficent funds in your account. Please try again by using a different method to complete the payment.
227FYour payment has failed due to a technical error. Please try again or use a different method to complete the payment.
313F Invalid SavedCardID
325FDuplicate Order Id
501FSystem Error
505FPlease try with lower amount or different payment mode. Transaction limits will revise as you continue using Paytm.
901FSubscription not available
905FInvalid Transaction Amount
910FSubscription is not configured for the merchant.
913F Invalid subscription amount type.
919FMerchant Not Found
924FWallet balance Insufficient
928FSubscription Renewal Rejected.
929F Invalid Subscription Details.
931FSubscription already in progress.
935FSubscription has been already cancelled.
945FManual renewal is not allowed as subscription has auto renewal preference configured.
947FManual retry is not allowed on subscription where autorenewal or auto retry is configured.
1102FSomething wents down, We are fixing the same
1103FThe Debit Date is invalid
1104FRenewal request is already pending in this frequency cycle
1105FThe Debit Date is beyond Subscription End Date
1106FDebit on a later date functionality not available for the the paymode linked to your subscription
2005F Checksum provided is invalid
3054FPrenotify not found for the given params
Staging
Production
https://securegw-stage.paytm.in/subscription/renew?mid={mid}&orderId={order-id}copy icon
REQUEST
RESPONSE
CURL
JAVA
NODE
PHP
PYTHON
DOTNET
curl -X POST 'https://securegw-stage.paytm.in/subscription/renew?mid={mid}&orderId=ORDERID_98765' \
--header 'Content-Type: application/json' \
--data '{"body":{"mid":"{mid}","orderId":"ORDERID_98765","subscriptionId":"67491","txnAmount":{"value":"1.00","currency":"INR"}},"head":{"signature":"{signature}"}}'
copy icon