Cancel Subscription API

Checksum required: YES

Use Case


  • To cancel existing subscription using merchant’s credentials - This can be used by any subscription merchant. Token Type required here is AES
  • To cancel existing subscription using customer’s credentials. This flow is used by customers to cancel their subscriptions from Paytm APP only. Token Type required here is SSO

Request Attributes:

API Content format: JSON

Head

PARAMETERDESCRIPTIONMANDATORY
clientId String (3)ClientId by which key checksum is created, required to validate the checksum. Eg C11NO
version String (4)Version of the API. Current version is v1YES
timestamp String (15)Unix timestamp of the time request is being sentYES
channelId String (3)For websites, the value is WEB, For Mobile websites/App, the value is WAPNO
tokenType AESWould be AES or SSO . AES – then signature is mandatory for checksum validation. This is used by merchants SSO – then ssoToken in body is mandatory. This is used by Paytm APPYES
signature String (108)Checksum string created by using Paytm checksum logicConditional

Body

PARAMETERDESCRIPTIONMANDATORY
mid StringMerchant unique identifier, Unique Id for merchant provided by PaytmYes
subsId String (50)Unique subscription id generated by Paytm for identifying a subscription.Yes
ssoToken StringUnique token for user authentication. Mandatory only in case of tokenType SSO is header.Conditional

Response Attributes:

API Content format: JSON

Head

PARAMETERDESCRIPTION
Version String (2)Version of the API passed in the request
responseTimestamp String 15UNIX Timestamp of the response
Signature String (108)Checksum string created by Paytm from response parameters

Body

PARAMETERDESCRIPTION
mid String (20)Merchant unique identifier, Unique Id for merchant provided by Paytm
subsId String (50)Unique subscription id generated by Paytm for identifying a subscription.
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
resultInfo Json ObjectInformation related to response of the request

resultInfo JSON Object

PARAMETERDESCRIPTION
resultCode String (5)Result code for each result
resultStatus String (10)Status of API call (Success/Failure)
resultMsg String (256)Message contain the information about the result

Cancel Subscription Response Codes, Messages and Status

CODEMESSAGESTATUS
200Subscription is unsubscribed successfully.NO CONTENT FOUND (In case where subscription is already cancelled)Success
401Authentication Failure.Fail
400Subscription 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 requestFail

Endpoints

Staging: https://securegw-stage.paytm.in/subscription/cancel

Production: https://securegw.paytm.in/subscription/cancel

Request CodeResponse JSON
curl -X POST 'https://securegw-stage.paytm.in/subscription/cancel' --header 'Content-Type: application/json' --data '{"body":{"mid":"xxxxxxxxxxxxxxxxxxxx","subsId":"xxxxx","ssoToken":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"},"head":{"version":"V1","requestTimestamp":xxxxxxxxxx,"tokenType":"SSO","signature":"xxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx//xxxxxxxxxxxxxxxx="}}'