Subscription Callback

PhonePe now internally can configure Callback urls along with username & password with sha256 for sending s2s response for merchants based on merchant request.

Currently this can be achieved through Shell script provided by us. Once the username and password is configured, PhonePe will pass the same SHA256 (username:password) as the “Authorization” header in s2s response which merchants can verify if this is matching with their configured value.

PhonePe will pass the authorization header as :

Authorization : SHA256(username:password)

Callback Validation/Verification flow for merchants

For the incoming request, extract the basic authorization header “Authorization”, verify it with the one which you have shared with us and accept the response if Username and password matches.

Sample Responses

Subscription Cancelled

{
    "type": "SUBSCRIPTION_CANCELLED",
    "payload": {
        "merchantSubscriptionId": "MS1708797962855",
        "subscriptionId": "OMS2402242336054995042603",
        "state": "CANCELLED",
        "authWorkflowType": "TRANSACTION",
        "amountType": "FIXED",
        "maxAmount": 200,
        "frequency": "ON_DEMAND",
        "expireAt": 1737278524000,
        "pauseStartDate": 1708798426196,
        "pauseEndDate": 1708885799000
    }
}

Subscription Revoked

{
    "type": "SUBSCRIPTION_REVOKED",
    "payload": {
        "merchantSubscriptionId": "MS1708797962855",
        "subscriptionId": "OMS2402242336054995042603",
        "state": "REVOKED",
        "authWorkflowType": "TRANSACTION",
        "amountType": "FIXED",
        "maxAmount": 200,
        "frequency": "ON_DEMAND",
        "expireAt": 1737278524000,
        "pauseStartDate": 1708798426196,
        "pauseEndDate": 1708885799000
    }
}

Subscription Paused

{
    "type": "SUBSCRIPTION_PAUSED",
    "payload": {
        "merchantSubscriptionId": "MS1708797962855",
        "subscriptionId": "OMS2402242336054995042603",
        "state": "PAUSED",
        "authWorkflowType": "TRANSACTION",
        "amountType": "FIXED",
        "maxAmount": 200,
        "frequency": "ON_DEMAND",
        "expireAt": 1737278524000,
        "pauseStartDate": 1708798426196,
        "pauseEndDate": 1708885799000
    }
}

Subscription Unpaused

{
    "type": "SUBSCRIPTION_UNPAUSED",
    "payload": {
        "merchantSubscriptionId": "MS1708797962855",
        "subscriptionId": "OMS2402242336054995042603",
        "state": "ACTIVE",
        "authWorkflowType": "TRANSACTION",
        "amountType": "FIXED",
        "maxAmount": 200,
        "frequency": "ON_DEMAND",
        "expireAt": 1737278524000,
        "pauseStartDate": null,
        "pauseEndDate": null
    }
}

Response Parameters

Parameter NameData TypeDescription
merchantSubscriptionIdStringUnique merchant subscription Id passed by the merchant while creating the subscription.
subscriptionIdStringPhone generated subscription Id.
stateStringStatus of the subscription. Possible values -:
ACTIVE,
CANCELLED,
REVOKED,
PAUSED
authWorkflowTypeStringType of Authorisation
amountTypeStringType of amount Fixed and Variable
maxAmountStringMax Amount that can be charged
frequencyStringFrequency type of subscription
expireAtDateTimeSubscription Expiry Time (in milliseconds)
pauseStartDateDateTimeSubscription pause start date only for Pause State or else null. (in milliseconds)
pauseEndDateDateTimeSubscription pause end date only for Pause state or else null. (in milliseconds)

Callback Types

FlowCallback Type
SetupSUBSCRIPTION_SETUP_ORDER_COMPLETED
SUBSCRIPTION_SETUP_ORDER_FAILED
NotificationSUBSCRIPTION_NOTIFICATION_COMPLETED
SUBSCRIPTION_NOTIFICATION_FAILED
RedemptionSUBSCRIPTION_REDEMPTION_ORDER_COMPLETED
SUBSCRIPTION_REDEMPTION_ORDER_FAILED
SUBSCRIPTION_REDEMPTION_TRANSACTION_COMPLETED
SUBSCRIPTION_REDEMPTION_TRANSACTION_FAILED
State ChangeSUBSCRIPTION_PAUSED
SUBSCRIPTION_UNPAUSED
SUBSCRIPTION_REVOKED
SUBSCRIPTION_CANCELLED