This API is used to get the status of the Subscription order placed.
Host Details
Environment | Value |
---|---|
UAT | https://api-preprod.phonepe.com/apis/pg-sandbox |
PROD | https://api.phonepe.com/apis/pg |
API Endpoint
/subscriptions/v2/order/{merchantOrderId}/status?details=true
Complete Host URL
Http Method: GET
Environment | Value |
---|---|
UAT | https://api-preprod.phonepe.com/apis/pg-sandbox/subscriptions/v2/order/{merchantOrderId}/status?details=true |
PROD | https://api.phonepe.com/apis/pg/subscriptions/v2/order/{merchantOrderId}/status?details=true |
Request Details
Request Headers
Header Name | Header Value |
---|---|
Content-Type | application/json |
Authorization | O-Bearer <access_token> |
Note: access_token can be generated using the Auth Token API. Refer here
Path Parameter Details
Parameter Name | Description |
---|---|
merchantOrderId | Merchant generated Order Id passed in Setup API |
Sample CURL
curl --location 'https://api-preprod.phonepe.com/apis/pg-sandbox/subscriptions/v2/order/MO1709025691805/status?details=true' \
--header 'Accept: application/json' \
--header 'Authorization: O-Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHBpcmVzT24iOjE3MTIyNTM2MjU2NDQsIm1lcmNoYW50SWQiOiJWMlNVQlVBVCJ9.7aVzYI_f_77-bBicEcRNuYx093b2wCsgl_WFNkKqAPY'
Response Details
Sample Response for Order status – Success
When Subscription state is – Notified
{
"merchantId": "SWIGGY8",
"merchantOrderId": "SWIGGY122",
"orderId": "OMO12344",
"amount": 100,
"state": "NOTIFIED",
"expireAt": 1620891733101,
"metaInfo": {
"udf1": <some meta info of max length 256>
"udf2": <some meta info of max length 256>
"udf3": <some meta info of max length 256>
"udf4": <some meta info of max length 256>
"udf5": <some meta info of max length 256>
}
"paymentFlow": {
"type": "SUBSCRIPTION_REDEMPTION",
"merchantSubscriptionId": "MS121312",
"redemptionRetryStrategy": "STANDARD",
"autoDebit": true,
"validAfter": "1628229131000",
"validUpto": "1628574731000",
"notifiedAt": "1622539751586"
}
}
Response Parameters
Parameter Name | Data Type | Description |
merchantId | STRING | Unique Id assigned to the merchant in the PhonePe system. Assigned during merchant onboarding. |
merchantOrderId | STRING | Unique OrderId passed by the merchant while creating the order. |
orderId | STRING | PhonePe generated orderID |
state | STRING | Status of the Notification. |
amount | LONG | Passed by the merchant in Paise |
expireAt | DateTime | Epoch Time |
MetaInfo | ARRAY | Metadata passed by the merchant only. |
paymentFlow | ARRAY | Detail of Subscription. |
paymentFlow.type | STRING | Type should be “SUBSCRIPTION_REDEMPTION” for redemption. |
paymentFlow.merchantSubscriptionId | STRING | Subscription ID passed by merchant |
paymentFlow.retryStrategy | STRING | STANDARD |
paymentFlow.autoDebit | BOOLEAN | If True, PhonePe will take care of execution. |
paymentFlow.validAfter | DateTime | Start Timestamp of the redemption window. |
paymentFlow.validUpto | DateTime | End Timestamp of the redemption window. |
paymentFlow.notifiedAt | DateTime | Timestamp when user was notified about the scheduled redemption. |
When Subscription state is – Redeemed
{
"merchantId": "SWIGGY8",
"merchantOrderId": "MO1232",
"orderId": "OMO12344",
"state": "COMPLETED",
"amount": 100,
"expireAt": 1620891733101,
"metaInfo": {
"udf1": <some meta info of max length 256>
"udf2": <some meta info of max length 256>
"udf3": <some meta info of max length 256>
"udf4": <some meta info of max length 256>
"udf5": <some meta info of max length 256>
},
"paymentFlow": {
"type": "SUBSCRIPTION_REDEMPTION",
"merchantSubscriptionId": "MS121312",
"redemptionRetryStrategy": "CUSTOM",
"autoDebit": true,
"validAfter": 1628229131000,
"validUpto": 1628574731000,
"notifiedAt": 1622539751586
},
"errorCode": <PRESENT ONLY IF STATE IS FAILED>
"detailedErrorCode": <PRESENT ONLY IF STATE IS FAILED>
"paymentDetails": [
{
"amount": 100
"paymentMode": "UPI_MANDATE",
"timestamp": 1620891733101
"transactionId": "OM124",
"state": "COMPLETED", // FAILED, PENDING
"rail": {
"type": "UPI",
"utr": "2",
"vpa": "abcd@ybl",
"umn": "544fcc8819d04cb08e26faa1fb07eee7@ybl"
},
"instrument": {
"type": "ACCOUNT",
"maskedAccountNumber": "XXX2312",
"ifsc": "VISA",
"accountHolderName": "Venkat",
"accountType": "SAVINGS"
},
"errorCode": <PRESENT ONLY IF ATTEMPT IS FAILED>
"detailedErrorCode": <PRESENT ONLY IF ATTEMPT IS FAILED>
}
]
}
Response Parameters
Parameter Name | Data Type | Description |
merchantId | STRING | Unique Merchant Id assigned to the merchant by PhonePe |
merchantOrderId | STRING | Unique OrderId passed by the merchant while creating the order. |
orderId | STRING | PhonePe generated orderID |
state | STRING | Status of the Notification. |
amount | LONG | Passed by the merchant in Paise |
expireAt | DateTime | Epoch Time (in milliseconds) |
MetaInfo | ARRAY | Metadata passed by the merchant only. |
paymentFlow | ARRAY | Detail of Subscription. |
paymentFlow.type | STRING | Type should be “SUBSCRIPTION_REDEMPTION” for redemption. |
paymentFlow.merchantSubscriptionId | STRING | Subscription ID passed by merchant |
paymentFlow.autoDebit | BOOLEAN | If True, PhonePe will take care of execution. |
paymentFlow.validAfter | DateTime | Start Timestamp of the redemption window. (in milliseconds) |
paymentFlow.validUpto | DateTime | End Timestamp of the redemption window. (in milliseconds) |
notifiedAt | DateTime | Timestamp when user was notified about the scheduled redemption. (in milliseconds) |
errorcode | STRING | Error code If the status failed. |
detailedErrorCode | STRING | Error code description If the status failed. |
paymentMode | STRING | Mode of Subscription Payment |
transactionId | STRING | PhonePe Generated Transaction ID |
state | STRING | Status of the debit |
rail | ARRAY | Details of the instrument and UMRN |
instrument | ARRAY | Details of Account |
errorCode | STRING | Error code present if attempt Failed |
detailedErrorCode | STRING | Error code description present if attempt Failed |