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'
Sample Response for Order status – Success
{
"merchantId": "SWIGGY8",
"merchantOrderId": "MO1708797962855",
"orderId": "OMO2402242336055135042802",
"state": "COMPLETED",
"amount": 200,
"expireAt": 1708798385505,
"paymentFlow": {
"type": "SUBSCRIPTION_SETUP",
"merchantSubscriptionId": "MS1708797962855",
"authWorkflowType": "TRANSACTION",
"amountType": "FIXED",
"maxAmount": 200,
"frequency": "ON_DEMAND",
"subscriptionId": "OMS2402242336054995042603"
},
"paymentDetails": [
{
"transactionId": "OM2402242336055865042862",
"paymentMode": "UPI_INTENT",
"timestamp": 1708797965588,
"amount": 200,
"state": "COMPLETED",
"instrument": {
"type": "ACCOUNT",
"maskedAccountNumber": "XXXXXXX20000",
"accountHolderName": "ABC",
"accountType": "SAVINGS"
},
"rail": {
"type": "UPI",
"utr": "405554491450",
"vpa": "999@ybl",
"umn": "d519347eb2374125bcad6e69a42cc13b@ybl"
},
"errorCode": <PRESENT ONLY IF TRANSACTION IS FAILED>
"detailedErrorCode": <PRESENT ONLY IF TRANSACTION IS FAILED>
}
]
}
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 (in milliseconds) |
MetaInfo | ARRAY | Metadata passed by the merchant only. |
paymentFlow | OBJECT | Detail of Subscription. |
paymentFlow.type | STRING | Type should be “SUBSCRIPTION_REDEMPTION” for redemption. |
paymentFlow.merchantSubscriptionId | STRING | Subscription ID passed by merchant |
paymentFlow.amountType | STRING | Nature of redemption amount Possible Values: ● FIXED ● VARIABLE |
paymentFlow.maxAmount | LONG | Max amount upto which redemptions will be allowed |
paymentFlow.frequency | STRING | Subscription frequency |
paymentFlow.subscriptionId | STRING | PhonePe generated Subscription Id |
paymentDetails | ARRAY | Details of the payment |