Redemption – Order Status

This API is used to get the status of the Subscription order placed.

Host Details

EnvironmentValue
UAThttps://api-preprod.phonepe.com/apis/pg-sandbox
PRODhttps://api.phonepe.com/apis/pg

API Endpoint

/subscriptions/v2/order/{merchantOrderId}/status?details=true

Complete Host URL

Http Method: GET

EnvironmentValue
UAThttps://api-preprod.phonepe.com/apis/pg-sandbox/subscriptions/v2/order/{merchantOrderId}/status?details=true
PRODhttps://api.phonepe.com/apis/pg/subscriptions/v2/order/{merchantOrderId}/status?details=true

Request Details

Request Headers

Header NameHeader Value
Content-Typeapplication/json
AuthorizationO-Bearer <access_token>

Note: access_token can be generated using the Auth Token API. Refer here

Path Parameter Details

Parameter NameDescription
merchantOrderIdMerchant 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 NameData TypeDescription
merchantIdSTRINGUnique Id assigned to the merchant in
the PhonePe system. Assigned during
merchant onboarding.
merchantOrderIdSTRINGUnique OrderId passed by the merchant
while creating the order.
orderIdSTRINGPhonePe generated orderID
stateSTRINGStatus of the Notification.
amountLONGPassed by the merchant in Paise
expireAtDateTimeEpoch Time
MetaInfoARRAYMetadata passed by the merchant only.
paymentFlowARRAYDetail of Subscription.
paymentFlow.typeSTRINGType should be
“SUBSCRIPTION_REDEMPTION” for
redemption.
paymentFlow.merchantSubscriptionIdSTRINGSubscription ID passed by merchant
paymentFlow.retryStrategySTRINGSTANDARD
paymentFlow.autoDebitBOOLEANIf True, PhonePe will take care of
execution.
paymentFlow.validAfterDateTimeStart Timestamp of the redemption window.
paymentFlow.validUptoDateTimeEnd Timestamp of the redemption window.
paymentFlow.notifiedAtDateTimeTimestamp 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 NameData TypeDescription
merchantIdSTRINGUnique Merchant Id assigned to the merchant by PhonePe
merchantOrderIdSTRINGUnique OrderId passed by the merchant while creating the order.
orderIdSTRINGPhonePe generated orderID
stateSTRINGStatus of the Notification.
amountLONGPassed by the merchant in Paise
expireAtDateTimeEpoch Time (in milliseconds)
MetaInfoARRAYMetadata passed by the merchant only.
paymentFlowARRAYDetail of Subscription.
paymentFlow.typeSTRINGType should be
“SUBSCRIPTION_REDEMPTION” for
redemption.
paymentFlow.merchantSubscriptionIdSTRINGSubscription ID passed by merchant
paymentFlow.autoDebitBOOLEANIf True, PhonePe will take care of
execution.
paymentFlow.validAfterDateTimeStart Timestamp of the redemption window.
(in milliseconds)
paymentFlow.validUptoDateTimeEnd Timestamp of the redemption window.
(in milliseconds)
notifiedAtDateTimeTimestamp when user was notified about the scheduled redemption.
(in milliseconds)
errorcodeSTRINGError code If the status failed.
detailedErrorCodeSTRINGError code description If the status failed.
paymentModeSTRINGMode of Subscription Payment
transactionIdSTRINGPhonePe Generated Transaction ID
stateSTRINGStatus of the debit
railARRAYDetails of the instrument and UMRN
instrumentARRAYDetails of Account
errorCodeSTRINGError code present if attempt Failed
detailedErrorCodeSTRINGError code description present if attempt Failed