PAUSE/UNPAUSE Subscription

Users can PAUSE/UNPAUSE the recurring payment in subscription from the PhonePe app under the AutoPay section. This is known as PAUSE/UNPAUSE Subscription. In such a case, PhonePe will send the S2S Callback response to inform the merchants.

  • Server-to-server callback responses for PAUSE/UNPAUSE are initiated from the PhonePe server to the URL provided by the merchant.
  • In order to receive the S2S response, register your Static Callback URL with PhonePe.
  • The payload that is going to be sent to the merchant on the specified callback URL will have a base64 encoded JSON. Upon validating the checksum and base64 decoding the response, you should get a JSON response.

S2S Callback - PAUSE/UNPAUSE Subscription

๐Ÿ“˜

Callback for PAUSE/UNPAUSE Subscription

The server to server callback for PAUSE/UNPAUSE Subscription will have the "callbackType": "SUBSCRIPTION".

๐Ÿšง

Validations

Validate the checksum which has been passed in the response headers received in the Server to Server callback.

Callback Headers

Following are the response headers sent with a callback.

Header NameHeader Value
Content-Typeapplication/json
X-VERIFYSHA256(base64response + salt key) + ### + salt index
X-CALLBACK-URLThe callback URL to receive the server-to-server callback response.
X-CALL-MODEThe value will be POST.

Sample S2S Response of PAUSE Subscription

{
  "response": "ewogICJzdWNjZXNzIjogdHJ1ZSwKICAiY29kZSI6ICJTVUNDRVNTIiwKICAibWVzc2FnZSI6ICJZb3VyIHN1YnNjcmlwdGlvbiBpcyBwYXVzZWQuIiwKICAiZGF0YSI6IHsKICAgICJjYWxsYmFja1R5cGUiOiAiU1VCU0NSSVBUSU9OIiwKICAgICJtZXJjaGFudElkIjogIk1JRDEyMzQ1IiwKICAgICJtZXJjaGFudFN1YnNjcmlwdGlvbklkIjogIk1TVUIxMjM0NTY3ODkwMTIzNDUiLAogICAgInN1YnNjcmlwdGlvbkRldGFpbHMiOiB7CiAgICAgICJzdWJzY3JpcHRpb25JZCI6ICJPTVMyMDA2MTEwMTM5NDUwMTIzNDU2Nzg5IiwKICAgICAgInN0YXRlIjogIlBBVVNFRCIsCiAgICAgICJzdGF0ZVN0YXJ0RGF0ZSI6IDE2NTMyNDQyMDAwMDAsCiAgICAgICJzdGF0ZUVuZERhdGUiOiAxNjUzMjQ0MjUwMDAwCiAgICB9CiAgfQp9"
}
{
  "success": true,
  "code": "SUCCESS",
  "message": "Your subscription is paused.",
  "data": {
    "callbackType": "SUBSCRIPTION",
    "merchantId": "MID12345",
    "merchantSubscriptionId": "MSUB123456789012345",
    "subscriptionDetails": {
      "subscriptionId": "OMS2006110139450123456789",
      "state": "PAUSED",
      "stateStartDate": 1653244200000,
      "stateEndDate": 1653244250000
    }
  }
}

๐Ÿšง

Key Points - PAUSE Subscription

  • Pause can be controlled only by the user on the PhonePe App

Sample S2S Response of UNPAUSE Subscription

{
  "response": "ewogICJzdWNjZXNzIjogdHJ1ZSwKICAiY29kZSI6ICJTVUNDRVNTIiwKICAibWVzc2FnZSI6ICJZb3VyIHN1YnNjcmlwdGlvbiBpcyBhY3RpdmUuIiwKICAiZGF0YSI6IHsKICAgICJjYWxsYmFja1R5cGUiOiAiU1VCU0NSSVBUSU9OIiwKICAgICJtZXJjaGFudElkIjogIk1JRDEyMzQ1IiwKICAgICJtZXJjaGFudFN1YnNjcmlwdGlvbklkIjogIk1TVUIxMjM0NTY3ODkwMTIzNDUiLAogICAgInN1YnNjcmlwdGlvbkRldGFpbHMiOiB7CiAgICAgICJzdWJzY3JpcHRpb25JZCI6ICJPTVMyMDA2MTEwMTM5NDUwMTIzNDU2Nzg5IiwKICAgICAgInN0YXRlIjogIkFDVElWRSIKICAgIH0KICB9Cn0="
}
{
  "success": true,
  "code": "SUCCESS",
  "message": "Your subscription is active.",
  "data": {
    "callbackType": "SUBSCRIPTION",
    "merchantId": "MID12345",
    "merchantSubscriptionId": "MSUB123456789012345",
    "subscriptionDetails": {
      "subscriptionId": "OMS2006110139450123456789",
      "state": "ACTIVE"
    }
  }
}

๐Ÿšง

Key Points - UNPAUSE Subscription

  • UnPause can be controlled by the user on the PhonePe App as well as by the merchant if the stateEndDate received in the Pause Callback has elapsed.

  • If the Recurring INIT notification is successful and then the user Pause the Subscription, in this case, the Redemption canโ€™t be executed.

  • Once the Recurring INIT notification is successful, the user Pause the Subscription. Now, if the user UNPause the Subscription, the Redemption canโ€™t be executed directly. Again the Recurring INIT has to be done and then followed by the Redemption after 24hrs from the Successful Notification.

  • Cancel/Revoke is allowed even if the mandate is in PAUSED State.

  • As a best practice and to avoid any known failures in Recurring INIT or Recurring Debit, it is recommended to call the Subscription Status and ensure the state is "ACTIVE" before any of these two API Calls.