search

POSTSubscription PreNotify API

Use Case

This is an asynchronous API to pre-notify user about the debit of the subscription.
Also, when successful notification has been sent to the user, a callback would be there to notify the same to the merchant as well.

Request Attributes

Content Type : JSON

Head

AttributeDescription
clientId
string
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

tokenType
string
mandatory

This parameter identifies whether the API works on checksum authentication.

The value to be sent in tokenType is 'AES' for this API.

signature
string
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.

timestamp
string
optional

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

Body

AttributeDescription
mid
string
mandatory

Paytm provides MID as a unique identifier to each merchant.

Example: INTEGR7769XXXXXX93833

subsId
string
mandatory

Subscription ID - Only Subscription Flow

txnAmount
string
mandatory

Order value of the transaction in INR.

Example: 1.00

txnDate
string
mandatory

Date on which the debit is intended to happen
Format DD-MM-YYYY

Example: 06-11-2020

txnMessage
string
optional

Reason for debit, length <= 200

referenceId
string
optional

Unique reference number, Length <= 32
Either referenceId or paytmReferenceId is Mandatory

Response Attributes

Content Type : JSON

Head

AttributeDescription
clientId
string

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

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

timestamp
string

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

Body

AttributeDescription
resultInfo
object

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

ResultInfo
+
AttributeDescription
code
string

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

status
string

This parameter indicates the status of API call.

Possible Values: SUCCESS, FAILURE

message
string(256)

This parameter is the result message which contains information about the result. The different result messages corresponding to this API are mentioned below.

paytmReferenceId
string

Reference Id

Response Codes & Messages

codestatusmessage
3006SUCCESSSUCCESS
400FAILUREThe request cannot be validated. Please refer to the doc and try again.
401FAILUREAuthentication Failure.
500FAILURESystem Error
3000FAILUREMERCHANT_NOT_FOUND
3004FAILURESubscription Not Found.
3005FAILURESome error occured.
3008FAILUREInvalid Subscription Amount
3046FAILURENotification has already been sent.
3047FAILUREInvalid Debit Date.
3049FAILUREDuplicate Reference Id.
Staging
Production
https://securegw-stage.paytm.in/subscription/preNotifycopy icon
REQUEST
RESPONSE
CURL
JAVA
NODE
PHP
PYTHON
DOTNET
curl -X POST 'https://securegw-stage.paytm.in/subscription/preNotify' \
-H 'Content-Type: application/json' \
--data-raw '{"head":{"signature" : "aesdg123456789jhdfgrtyuaaaa=","tokenType" : "AES" },"body":{"subsId" : "7271","mid" : "{mid}","txnAmount":"2000","txnDate":"06-11-2020","txnMessage" :"subscription for postpaid mobile bill" ,"referenceId" : "NspPa6464ndCre985T5998985456"}}'
copy icon