Order Status API
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 Name | Header Value |
---|---|
Content-Type | application/json |
Authorization | O-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 Name | Header Value |
---|---|
Content-Type | application/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 Name | Data Type | Description |
---|---|---|
orderId | String | PG generated internal order id |
state | String | State of order, Expected Values = [PENDING, FAILED, COMPLETED] |
amount | String | Order amount in paisa |
expireAt | Long | order expiry time in epoch |
metaInfo | Object | Merchant defined meta info passed at the time of order creation |
paymentDetails | List | Contain list of details of each payment attempt made corresponding to this order. |
paymentDetails.paymentMode | String | Mode of payment. Expected Values = [UPI_INTENT, UPI_COLLECT, UPI_QR, CARD, TOKEN, NET_BANKING] |
paymentDetails.timestamp | Long | Transaction attempt timestamp in epoch |
paymentDetails.amount | Long | Amount in paisa, corresponding to payment attempt |
paymentDetails.transactionId | String | internal transaction id for given payment attempt |
paymentDetails.state | String | Transaction attempt state. Expected Values = [PENDING, COMPLETED, FAILED] |
paymentDetails.errorCode | String | Error code (Only present when transaction state is failed) |
paymentDetails.detailedErrorCode | String | Detailed Error Code (Only present when transaction state is failed) |
paymentDetails.rail | String | Contains processing rail details under which payment attempt is made. |
paymentDetails.rail.type | String | Type of rail. Expected values = [UPI, PG] |
paymentDetails.instrument | String | Contains instrument details |
paymentDetails.instrument.type | String | Type 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>"
}
Transaction Status API
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 Name | Header Value |
---|---|
Content-Type | application/json |
Authorization | O-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 Name | Header Value |
---|---|
Content-Type | application/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 Name | Data Type | Description |
---|---|---|
orderId | String | PG generated internal order id |
state | String | State of order, Expected Values = [PENDING, FAILED, COMPLETED] |
amount | String | Order amount in paisa |
expireAt | Long | order expiry time in epoch |
metaInfo | Object | Merchant defined meta info passed at the time of order creation |
paymentDetails | List | Contain list of details of each payment attempt made corresponding to this order. |
paymentDetails.paymentMode | String | Mode of payment. Expected Values = [UPI_INTENT, UPI_COLLECT, UPI_QR, CARD, TOKEN, NET_BANKING] |
paymentDetails.timestamp | Long | Transaction attempt timestamp in epoch |
paymentDetails.amount | Long | Amount in paisa, corresponding to payment attempt |
paymentDetails.transactionId | String | internal transaction id for given payment attempt |
paymentDetails.state | String | Transaction attempt state. Expected Values = [PENDING, COMPLETED, FAILED] |
paymentDetails.errorCode | String | Error code (Only present when transaction state is failed) |
paymentDetails.detailedErrorCode | String | Detailed Error Code (Only present when transaction state is failed) |
paymentDetails.rail | String | Contains processing rail details under which payment attempt is made. |
paymentDetails.rail.type | String | Type of rail. Expected values = [UPI, PG] |
paymentDetails.instrument | String | Contains instrument details |
paymentDetails.instrument.type | String | Type of payment instrument. Expected values = [ACCOUNT, CREDIT_CARD, DEBIT_CARD, NET_BANKING] |