search
Your Paytm for business app is working and will keep working beyond March 15th, 2024. Click to know more

POSTCancel Subscription API

Use Case

This API is used to cancel the existing subscription using merchant’s credentials - This can be used by any subscription merchant. Token Type required here is AES.

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"
tokenType
string
mandatory

AES – signature is mandatory for checksum validation.

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

subsId
string
mandatory

Subscription ID - Only Subscription flow

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

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

mid
string(20)

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

subsId
string

Subscription ID - Only Subscription flow

custId
string(64)

Customer ID whose subscription is being cancelled

createdDate
string(15)

Creation date of subscription

expiryDate
string(15)

Expiry date of subscription set at the time of creation

Response Codes & Messages

codestatusmessage
200 SUCCESSSubscription is unsubscribed successfully. NO CONTENT FOUND (In case where subscription is already cancelled).
400 FAILURESubscription Id field can not be empty. Failed in cancelling subscription. Token not associated with subsId passed in request. MID not associated with subsId passed in request.
401 FAILURE Authentication Failure.
4001 FAILURE Invalid Subscription start date. Invalid Frequency Unit.
Staging
Production
https://securegw-stage.paytm.in/subscription/cancelcopy icon
REQUEST
RESPONSE
CURL
JAVA
NODE
PHP
PYTHON
DOTNET
curl -X POST 'https://securegw-stage.paytm.in/subscription/cancel' \
--header 'Content-Type: application/json' \
--data '{"body":{"mid":"{mid}","subsId":"67491"},"head":{"tokenType":"AES","signature":"{signature}"}}'
copy icon