• Getting Started
    • Website Integration
      Mobile Integration (Android/IOS)
      Enterprise Solutions
      Accept Payments
      Process Payments
      Disbursals
      API References
      Webhooks
      Testing
      Refunds
      Guides
      Other Processes

      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

      ATTRIBUTEDESCRIPTIONMANDATORY
      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 v1No
      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

      ATTRIBUTEDESCRIPTIONMANDATORY
      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

      Head

      ATTRIBUTEDESCRIPTION
      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

      ATTRIBUTEDESCRIPTION
      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
      resultInfoInformation related to response of the request

      ResultInfo

      ATTRIBUTEDESCRIPTIONMANDATORY
      resultCode String (5)Result code for each resultYes
      resultStatus String (10)Status of API call (Success/Failure)
      (S:Success, F:Failure, U:Unknown)
      Yes
      resultMsg String (256)Message contain the information about the resultYes

      Response Codes and Messages

      resultCoderesultStatusresultMsg
      200SUCCESSSubscription is unsubscribed successfully. NO CONTENT FOUND (In case where subscription is already cancelled)
      400FAILURESubscription 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
      401FAILUREAuthentication Failure.

      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":"{mid}","subsId":"{subscription-id}"},"head":{"tokenType":"AES","signature":"{signature}"}}'