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 Name | Data Type | Description |
---|---|---|
merchantSubscriptionId | String | Unique merchant subscription Id passed by the merchant while creating the subscription. |
subscriptionId | String | Phone generated subscription Id. |
state | String | Status of the subscription. Possible values -: ACTIVE, CANCELLED, REVOKED, PAUSED |
authWorkflowType | String | Type of Authorisation |
amountType | String | Type of amount Fixed and Variable |
maxAmount | String | Max Amount that can be charged |
frequency | String | Frequency type of subscription |
expireAt | DateTime | Subscription Expiry Time (in milliseconds) |
pauseStartDate | DateTime | Subscription pause start date only for Pause State or else null. (in milliseconds) |
pauseEndDate | DateTime | Subscription pause end date only for Pause state or else null. (in milliseconds) |
Callback Types
Flow | Callback Type |
---|---|
Setup | SUBSCRIPTION_SETUP_ORDER_COMPLETED SUBSCRIPTION_SETUP_ORDER_FAILED |
Notification | SUBSCRIPTION_NOTIFICATION_COMPLETED SUBSCRIPTION_NOTIFICATION_FAILED |
Redemption | SUBSCRIPTION_REDEMPTION_ORDER_COMPLETED SUBSCRIPTION_REDEMPTION_ORDER_FAILED SUBSCRIPTION_REDEMPTION_TRANSACTION_COMPLETED SUBSCRIPTION_REDEMPTION_TRANSACTION_FAILED |
State Change | SUBSCRIPTION_PAUSED SUBSCRIPTION_UNPAUSED SUBSCRIPTION_REVOKED SUBSCRIPTION_CANCELLED |