Get Transaction Details

Stay organized with collections Save and categorize content based on your preferences.

After the payment is initiated, you can use this API to get the transaction details of an order.

Request

To get the transaction details, make a POST request to the following endpoint:

Prod

POST https://nbupayments.googleapis.com/v1/merchantTransactions:get

Request Body

{
  // Merchant identifier, googleMerchantId should be set. This ID is globally
  // unique across all Google Pay merchants.
  "merchantInfo": {
    "googleMerchantId": "ABCDE12345"
    },
   // Merchant transaction ID for which payment details need to be fetched.
   "transactionIdentifier": {
     "merchantTransactionId": "someTransactionId"
    }
}

Request Body parameters

Merchant Info

The following data parameter for the merchantInfo object must be passed in the API request:

Parameters Type of value Description Required/Optional
googleMerchantId String Google assigned merchant ID. Generated during onboarding. Required
Transaction Id

You must pass the unique transaction ID that you generated while creating the payment/order in the merchantTransactionId key. It is a required field.

Response

The response contains "UPI" as the value for paymentMode object and one of the following possible values for the transactionStatus object.

  • SUCCESS
  • FAILURE: Transaction has failed
  • IN_PROGRESS: Transaction is in progress
  • PAYMENT_NOT_INITIATED: Payment hasn't been initiated by the user
  • DECLINED: Payment has been declined by the user
  • EXPIRED: Payment request expired

Successful response

If successful, the GET request returns a 200 OK HTTP status code, including the following response:

{
  // Merchant transaction ID for which payment details are fetched.
  "transactionId": "someTransactionId",
  // Google’s transaction ID.
  "googleTransactionId": "someGoogleTransactionId",
  // Mode of payment that the user used.
  "paymentMode": "UPI",
  // Status of the transaction.
  "transactionStatus": {
    "status": "SUCCESS"
    },
  // Transaction details for UPI transaction.
  "upiTransactionDetails": {
    "upiRrn": "abcdef",
    },
 // Amount paid by the user (only present if the transactionStatus is SUCCESS)
   "amountPaid": {
    "currencyCode": "INR",
    "units": "100",
    "nanos": "0"
    },
 // Time at which transaction was last updated in RFC 3339 format
   "lastUpdatedTime": "2022-01-31T11:00:44.735Z"

}

Failure response

The API returns the following response in case of a failure:

{
  // Merchant transaction ID for which payment details are fetched.
  "transactionId": "someTransactionId",
  // Google’s transaction ID.
  "googleTransactionId": "someGoogleTransactionId",
  // Mode of payment that the user used.
  "paymentMode": "UPI",
  // Status of the transaction.
  "transactionStatus": {
    "status": "FAILURE",
    // (String) failure error code describing the reason behind the failure
    "failureErrorCode": "BENEFICIARY_VPA_RESTRICTED"
   },
  // Transaction details for UPI transactions.
  "upiTransactionDetails": {
    "upiRrn": "abcdef",
    },
  // Time at which transaction was last updated in RFC 3339 format
  "lastUpdatedTime": "2022-01-31T11:00:44.735Z"
}

In case of a malformed request, you will receive the following response with an appropriate error message and error code:

{
  "error": {
    "code": 400,
    "status": "INVALID_ARGUMENT",
    "message": "MerchantInfo not present"
  }
}

Malformed request error codes

Code Title Description
403 PERMISSION_DENIED The merchant is not authorized.
400 INVALID_ARGUMENT Request contains an invalid argument.
404 NOT_FOUND Request contains invalid transaction ID.