Check Status

anchor image
Copied !

This API is used to check the payment status: 

API Details : 

GET https://api-preprod.phonepe.com/apis/pg-sandbox/payments/v2/order/{merchantOrderId}/status

Request Details

Request Headers

Header NameHeader Value
Content-Typeapplication/json
AuthorizationO-Bearer <merchant-auth-token>

Header details : 

  • Content-Type – Its value should be always application/json, meaning this API responds to only when content is in format of application/json
  • Authorization – This should be the auth token that you have received from the Auth API.

Response Details

Response Headers:

Header NameHeader Value
Content-Typeapplication/json

Response Payload:

Case 1: order is completed

{ "orderId": "OMOxx", "state": "COMPLETED", "amount": 10000, "expireAt": 1291391291, "metaInfo": { "udf1": "", "udf2": "", "udf3": "", "udf4": "", "udf5": "" }, "errorCode" : "AUTHORIZATION_ERROR", // Only present in case of failed transaction attempt and order not completed "detailedErrorCode": "ZM", // Only present in case of failed transaction attempt and order not completed "paymentDetails": [{ "paymentMode" : "UPI_QR", "transactionId" : "OM12334", "timestamp": 12121212, "amount": 10000, "state" : "COMPLETED", "rail" : { "type" : "UPI", "upiTransactionId" : "upi12313", "vpa" : "abcd@ybl" }, "instrument" : { "type" : "ACCOUNT", "accountType" : "SAVINGS", "accountNumber" : "121212121212" } }] }

Case 2: No payment attempt is made for order

{ "orderId": "OMOxx", "state": "CREATED", "amount": 10000, "expireAt": 1291391291, "metaInfo": { "udf1": "", "udf2": "", "udf3": "", "udf4": "" } }

Case 3: Invalid order ID

{ "code": "INVALID_MERCHANT_ORDER_ID", "message": "No entry found for given merchant order id" }

Response Field Details:

Header NameData TypeDescription
orderIdStringPG generated internal order id
stateStringState of order, Expected Values = [PENDING, FAILED, COMPLETED]
amountStringOrder amount in paisa
expireAtLongorder expiry time in epoch
metaInfoObjectMerchant defined meta info passed at the time of order creation
paymentDetailsListContain list of details of each payment attempt made corresponding to this order.
paymentDetails.paymentModeStringMode of payment. Expected Values = [UPI_INTENT, UPI_COLLECT, UPI_QR, CARD, TOKEN, NET_BANKING]
paymentDetails.timestampLongTransaction attempt timestamp in epoch
paymentDetails.amountLongAmount in paisa, corresponding to payment attempt
paymentDetails.transactionIdStringinternal transaction id for given payment attempt
paymentDetails.stateStringTransaction attempt state. Expected Values = [PENDING, COMPLETED, FAILED]
paymentDetails.errorCodeStringError code (Only present when transaction state is failed)
paymentDetails.detailedErrorCodeStringDetailed Error Code (Only present when transaction state is failed)
paymentDetails.railStringContains processing rail details under which payment attempt is made.
paymentDetails.rail.typeStringType of rail. Expected values = [UPI, PG]
paymentDetails.instrumentStringContains instrument details
paymentDetails.instrument.typeStringType of payment instrument. Expected values = [ACCOUNT, CREDIT_CARD, DEBIT_CARD, NET_BANKING]

Rail and Instrument Values for Each Payment Mode

Rail = “UPI”, When payment Mode = [UPI_INTENT, UPI_COLLECT, UPI_QR]

"rail": { "type": "UPI", "utr": "<utr>", "upiTransactionId": "upi12313", "vpa": "abcd@ybl" }

Rail = “PG”, When payment Mode = [CARD, TOKEN, NET_BANKING]

"rail": { "type": "PG", "transactionId": "<transactionId>", "authorizationCode": "<authorizationCode>", "serviceTransactionId": "<serviceTransactionId>" }

Instrument = “ACCOUNT”, When payment Mode = [UPI_INTENT, UPI_COLLECT, UPI_QR]

"instrument": { "type": "ACCOUNT", "accountType": "SAVINGS", "maskedAccountNumber": "<maskedAccountNumber>", "ifsc": "<ifsc>", "accountHolderName": "<accountHolderName>" }

Instrument = “CREDIT_CARD”, When payment Mode = [CARD, UPI_INTENT, UPI_COLLECT, UPI_QR]

"instrument": { "type": "CREDIT_CARD", "bankTransactionId": "<bankTransactionId>", "bankId": "<bankId>", "arn": "<arn>", "brn": "<brn>" }

Instrument = “DEBIT_CARD”, When payment Mode = [CARD]

"instrument": { "type": "DEBIT_CARD", "bankTransactionId": "<bankTransactionId>", "bankId": "<bankId>", "arn": "<arn>", "brn": "<brn>" }

Instrument = “NET_BANKING”, When payment Mode = [NET_BANKING]

"instrument": { "type": "NET_BANKING", "bankTransactionId": "<bankTransactionId>", "bankId": "<bankId>", "arn": "<arn>", "brn": "<brn>" }
anchor image
Copied !

This API is used to check the status of a particular transaction using the transaction IDs returned in the Order Status API response.

API Details : 

GET https://api-preprod.phonepe.com/apis/pg-sandbox/payments/v2/transaction/{transactionId}/status

Request Details

Request Headers

Header NameHeader Value
Content-Typeapplication/json
AuthorizationO-Bearer <merchant-auth-token>

Header details : 

  • Content-Type – Its value should be always application/json, meaning this API responds to only when content is in format of application/json
  • Authorization – This should be the auth token that you have received from the Auth API.

Response Details

Response Headers:

Header NameHeader Value
Content-Typeapplication/json

Response Payload:

Case 1: order is completed

{ "orderId": "OMOxx", "state": "COMPLETED", "amount": 10000, "expireAt": 1291391291, "metaInfo": { "udf1": "", "udf2": "", "udf3": "", "udf4": "" }, "errorCode" : "AUTHORIZATION_ERROR", // Only present in case of failed transaction attempt and order not completed "detailedErrorCode": "ZM", // Only present in case of failed transaction attempt and order not completed "paymentDetails": [{ "paymentMode" : "UPI_COLLECT", "timestamp": 12121212, "amount": 10000, "transactionId" : "OM12333", "state": "COMPLETED", "rail":{ "type": "UPI", "upiTransactionId" : "upi12313", "vpa" : "abcd@ybl" }, "instrument" : { "type": "ACCOUNT", "accountType": "SAVINGS", "accountNumber" : "121212121212" } }] }

Case 2: Invalid order ID

{ "code": "INVALID_TRANSACTION_ID", "message": "No entry found for given transaction id" }

Response Field Details:

Header NameData TypeDescription
orderIdStringPG generated internal order id
stateStringState of order, Expected Values = [PENDING, FAILED, COMPLETED]
amountStringOrder amount in paisa
expireAtLongorder expiry time in epoch
metaInfoObjectMerchant defined meta info passed at the time of order creation
paymentDetailsListContain list of details of each payment attempt made corresponding to this order.
paymentDetails.paymentModeStringMode of payment. Expected Values = [UPI_INTENT, UPI_COLLECT, UPI_QR, CARD, TOKEN, NET_BANKING]
paymentDetails.timestampLongTransaction attempt timestamp in epoch
paymentDetails.amountLongAmount in paisa, corresponding to payment attempt
paymentDetails.transactionIdStringinternal transaction id for given payment attempt
paymentDetails.stateStringTransaction attempt state. Expected Values = [PENDING, COMPLETED, FAILED]
paymentDetails.errorCodeStringError code (Only present when transaction state is failed)
paymentDetails.detailedErrorCodeStringDetailed Error Code (Only present when transaction state is failed)
paymentDetails.railStringContains processing rail details under which payment attempt is made.
paymentDetails.rail.typeStringType of rail. Expected values = [UPI, PG]
paymentDetails.instrumentStringContains instrument details
paymentDetails.instrument.typeStringType of payment instrument. Expected values = [ACCOUNT, CREDIT_CARD, DEBIT_CARD, NET_BANKING]