Check Order Status


  • This API helps you check whether the subscription has been successfully created, is still pending user action, has failed, or is complete.
  • Once the user completes the mandate through Payment Service Provider( PhonePe, BHIM, GPay, Paytm, CRED, Amazon Pay) app, use this API to check the status of a subscription setup after initiating it.
EnvironmentHTTP MethodAPI
SandboxGEThttps://api-preprod.phonepe.com/apis/pg-sandbox/subscriptions/v2/order/{merchantOrderId}/status?details=true
ProductionGEThttps://api.phonepe.com/apis/pg/subscriptions/v2/order/{merchantOrderId}/status?details=true
Request Headers
Header NameHeader Value
Content-Typeapplication/json
AuthorizationO-Bearer <merchant-auth-token>

⚠️ For Partner Integrations!


It is mandatory to include the X-MERCHANT-ID header with the MerchantID of the end merchant.

Path Parameters Details
Parameter NameDescription
merchantOrderIdMerchant-generated order ID provided during the Subscription Setup API call.
Sample Request in 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 Success
{
    "merchantId": "SWIGGY8",
    "merchantOrderId": "MO1708797962855",
    "orderId": "OMO2402242336055135042802",
    "state": "COMPLETED",
    "amount": 200,
    "expireAt": 1708798385505,
    "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",
        "udf6": "some meta info of max length 256",
        "udf7": "some meta info of max length 256",
        "udf8": "some meta info of max length 256",
        "udf10": "some meta info of max length 256",
        "udf11": "some meta info of max length 50",
        "udf12": "some meta info of max length 50",
        "udf13": "some meta info of max length 50",
        "udf14": "some meta info of max length 50",
        "udf15": "some meta info of max length 50"
    },
    "paymentFlow": {
        "type": "SUBSCRIPTION_SETUP",
        "merchantSubscriptionId": "MS1708797962855",
        "authWorkflowType": "TRANSACTION",
        "amountType": "FIXED",
        "maxAmount": 200,
        "frequency": "ON_DEMAND",
        "expireAt": 1741345725943,
        "subscriptionId": "OMS2502051638460659623138"
    },
    "paymentDetails": [
        {
            "transactionId": "OM2402242336055865042862",
            "paymentMode": "UPI_INTENT",
            "timestamp": 1708797965588,
            "amount": 200,
            "payableAmount": 200,
            "feeAmount": 0,
            "state": "COMPLETED",
            "instrument": {
                "type": "ACCOUNT",
                "maskedAccountNumber": "XXXXXXXXXXX0945"
            },
            "rail": {
                "type": "UPI",
                "utr": "405554491450",
                "vpa": "12****78@ybl",
                "umn": "d519347eb2374125bcad6e69a42cc13b@ybl"
            }
      }
    ]
}
Sample Order Status Response for Failure
{
    "merchantId": "SWIGGY8",
    "merchantOrderId": "MO1708797962855",
    "orderId": "OMO2402242336055135042802",
    "state": "FAILED",
    "amount": 200,
    "expireAt": 1708798385505,
    "errorCode": "INVALID_MPIN",
    "detailedErrorCode": "ZM",
    "paymentFlow": {
        "type": "SUBSCRIPTION_SETUP",
        "merchantSubscriptionId": "MS1708797962855",
        "authWorkflowType": "TRANSACTION",
        "amountType": "FIXED",
        "maxAmount": 200,
        "frequency": "ON_DEMAND",
        "expireAt": 1741345725943,
        "subscriptionId": "OMS2502051638460659623138"
    },
    "paymentDetails": [
        {
            "transactionId": "OM2402242336055865042862",
            "paymentMode": "UPI_INTENT",
            "timestamp": 1708797965588,
            "amount": 200,
            "payableAmount": 200,
            "feeAmount": 0,
            "state": "FAILED",
            "errorCode": "INVALID_MPIN",
            "detailedErrorCode": "ZM"
        }
    ]
}
Sample Order Status Response – Pending
{
    "merchantId": "SWIGGY8",
    "merchantOrderId": "MO1708797962855",
    "orderId": "OMO2402242336055135042802",
    "state": "PENDING",
    "amount": 200,
    "expireAt": 1708798385505,
    "paymentFlow": {
        "type": "SUBSCRIPTION_SETUP",
        "merchantSubscriptionId": "MS1708797962855",
        "authWorkflowType": "TRANSACTION",
        "amountType": "FIXED",
        "maxAmount": 200,
        "frequency": "ON_DEMAND",
        "expireAt": 1741345725943,
        "subscriptionId": "OMS2502051638460659623138"
    },
    "paymentDetails": [
        {
            "transactionId": "OM2402242336055865042862",
            "paymentMode": "UPI_INTENT",
            "timestamp": 1708797965588,
            "amount": 200,
            "payableAmount": 200,
            "feeAmount": 0,
            "state": "PENDING"
        }
    ]
}
Response Parameters
Parameter NameData TypeDescription
merchantIdStringA unique ID assigned to the merchant by the PhonePe system during the onboarding process.
merchantOrderIdStringA unique orderId provided by the merchant when creating the order. This helps in tracking and managing the specific transaction across systems.
orderIdStringAn orderId generated by PhonePe.
stateStringPossible value:
• COMPLETED
• FAILED
• PENDING
amountLongThe amount provided by the merchant in Paise.
expireAtDateTimeRepresents the time in epoch (milliseconds).
errorCodeStringIndicates the reason for the failure.
[PRESENT ONLY IF STATE = FAILED]
detailedErrorCodeStringProvides a detailed explanation for the failure.
MetaInfoArrayContains metadata provided by the merchant.
paymentFlowObjectProvides the detailed information of the subscription.
paymentDetailsArrayContains the details of the payment.

The metaInfo object contains additional parameters, which are explained in the table below.

Request Parameters of metoInfo Object:
Parameter NameData TypeDescriptionMandatory (Yes/No)Constraints
metaInfo.udf1-15StringOptional details you can add for more informationNoMaximum length for Udf1-10 = 256 characters
Maximum length for Udf11-15 = 50 characters

The paymentFlow object contains additional parameters, which are explained in the table below.

Request Parameters of paymentFlow Object:
Parameter NameData TypeDescription
paymentFlow.typeStringThe type should be set to “SUBSCRIPTION_REDEMPTION” for redemption transactions.
paymentFlow.merchantSubscriptionIdStringA unique subscriptionId provided by the merchant to identify and manage the subscription request.
paymentFlow.amountTypeStringNature of redemption amount
Possible Values:
• FIXED
• VARIABLE
paymentFlow.maxAmountLongSpecifies the maximum amount that can be debited from the user’s account for each redemption cycle.
paymentFlow.frequencyStringDefines how often the payment will be deducted from the user’s account.
paymentFlow.subscriptionIdStringA subscriptionId generated by PhonePe to uniquely identify the user’s subscription.
headers
url params

You can also test this API request directly in Postman for a quick and easy integration check.

After retrieving the subscription order status, the next step is to check the current status of a subscription after it has been set up.

Is this article helpful?