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":750000000},// Time at which transaction was last updated in RFC 3339 format"lastUpdatedTime":"2022-01-31T11:00:44.735Z",// Payer account type: UPI_CREDIT, UPI_DEBIT (only populated for allowlisted merchants)"payerAccountType":"UPI_DEBIT",// Payee VPA of the transaction (only populated for allowlisted merchants)"payeeVpa":"your-merchant-vpa@acquiringbank"}
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",// Payer account type: UPI_CREDIT, UPI_DEBIT (only populated for allowlisted merchants)"payerAccountType":"UPI_DEBIT",// Payee VPA of the transaction (only populated for allowlisted merchants)"payeeVpa":"your-merchant-vpa@acquiringbank"}
In case of a malformed request, you will receive the following response with
an appropriate error message and error code:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-16 UTC."],[[["\u003cp\u003eThis API retrieves the transaction details of an order after payment initiation using a POST request.\u003c/p\u003e\n"],["\u003cp\u003eIt is crucial to verify the payment status with your payment service provider and cross-check the amount with the API response before fulfilling the order.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires your Google Merchant ID and the unique Merchant Transaction ID.\u003c/p\u003e\n"],["\u003cp\u003eThe API response includes transaction status (SUCCESS, FAILURE, IN_PROGRESS, etc.), payment mode, and other relevant details.\u003c/p\u003e\n"],["\u003cp\u003eError responses provide specific codes and messages for troubleshooting, such as invalid arguments or unauthorized access.\u003c/p\u003e\n"]]],["To retrieve order transaction details after payment initiation, send a POST request to `https://nbupayments.googleapis.com/v1/merchantTransactions:get`. The request body must include your `googleMerchantId` and the `merchantTransactionId`. The response provides the transaction's status (SUCCESS, FAILURE, etc.), payment mode, and details like the Google transaction ID and the amount paid. Verify the transaction status with your payment service provider and reconcile any failed payments.\n"],null,["# Get Transaction Details\n\nAfter the payment is initiated, you can use this API to get the transaction\ndetails of an order.\n| **Important:**\n|\n| We strongly recommend that you\n| check the payment transaction status with your payment service provider (PSP).\n| This is to ensure that the transaction is successful before you deliver the\n| goods or services. This also helps you to follow up on the payment status\n| and perform reconciliation if the payment fails.\n|\n| We also recommend you to check the amount paid in the response received from\n| the PSP and \\`GetTransactionDetails\\` API response from Google.\n\nRequest\n-------\n\nTo get the transaction details, make a POST request to the following endpoint:\n\n**Prod** \n\n POST https://nbupayments.googleapis.com/v1/merchantTransactions:get\n\n| **Note:** If you want to test against test endpoints, reach out to your Google point of contact for the details.\n\n### Request Body\n\n {\n // Merchant identifier, googleMerchantId should be set. This ID is globally\n // unique across all Google Pay merchants.\n \"merchantInfo\": {\n \"googleMerchantId\": \"ABCDE12345\"\n },\n // Merchant transaction ID for which payment details need to be fetched.\n \"transactionIdentifier\": {\n \"merchantTransactionId\": \"someTransactionId\"\n }\n }\n\n#### Request Body parameters\n\n##### Merchant Info\n\nThe following data parameter for the `merchantInfo` object must be passed in the\nAPI request:\n\n| Parameters | Type of value | Description | Required/Optional |\n|--------------------|---------------|-----------------------------------------------------------|-------------------|\n| `googleMerchantId` | String | Google assigned merchant ID. Generated during onboarding. | Required |\n\n##### Transaction Id\n\nYou must pass the unique transaction ID that you generated while creating the\npayment/order in the `merchantTransactionId` key. It is a **required** field.\n\nResponse\n--------\n\nThe response contains \"UPI\" as the value for `paymentMode` object and one of the\nfollowing possible values for the `transactionStatus` object.\n\n- SUCCESS\n- FAILURE: Transaction has failed\n- IN_PROGRESS: Transaction is in progress\n- PAYMENT_NOT_INITIATED: Payment hasn't been initiated by the user\n- DECLINED: Payment has been declined by the user\n- EXPIRED: Payment request expired\n\n### Successful response\n\nIf successful, the GET request returns a `200 OK` HTTP status code, including\nthe following response: \n\n {\n // Merchant transaction ID for which payment details are fetched.\n \"transactionId\": \"someTransactionId\",\n // Google's transaction ID.\n \"googleTransactionId\": \"someGoogleTransactionId\",\n // Mode of payment that the user used.\n \"paymentMode\": \"UPI\",\n // Status of the transaction.\n \"transactionStatus\": {\n \"status\": \"SUCCESS\"\n },\n // Transaction details for UPI transaction.\n \"upiTransactionDetails\": {\n \"upiRrn\": \"abcdef\"\n },\n // Amount paid by the user (only present if the transactionStatus is SUCCESS)\n \"amountPaid\": {\n \"currencyCode\": \"INR\",\n \"units\": \"100\",\n \"nanos\": 750000000\n },\n // Time at which transaction was last updated in RFC 3339 format\n \"lastUpdatedTime\": \"2022-01-31T11:00:44.735Z\",\n\n // Payer account type: UPI_CREDIT, UPI_DEBIT (only populated for allowlisted merchants)\n \"payerAccountType\": \"UPI_DEBIT\",\n // Payee VPA of the transaction (only populated for allowlisted merchants)\n \"payeeVpa\": \"your-merchant-vpa@acquiringbank\"\n\n }\n\n### Failure response\n\nThe API returns the following response in case of a failure: \n\n {\n // Merchant transaction ID for which payment details are fetched.\n \"transactionId\": \"someTransactionId\",\n // Google's transaction ID.\n \"googleTransactionId\": \"someGoogleTransactionId\",\n // Mode of payment that the user used.\n \"paymentMode\": \"UPI\",\n // Status of the transaction.\n \"transactionStatus\": {\n \"status\": \"FAILURE\",\n // (String) failure error code describing the reason behind the failure\n \"failureErrorCode\": \"BENEFICIARY_VPA_RESTRICTED\"\n },\n // Transaction details for UPI transactions.\n \"upiTransactionDetails\": {\n \"upiRrn\": \"abcdef\"\n },\n // Time at which transaction was last updated in RFC 3339 format\n \"lastUpdatedTime\": \"2022-01-31T11:00:44.735Z\",\n\n // Payer account type: UPI_CREDIT, UPI_DEBIT (only populated for allowlisted merchants)\n \"payerAccountType\": \"UPI_DEBIT\",\n // Payee VPA of the transaction (only populated for allowlisted merchants)\n \"payeeVpa\": \"your-merchant-vpa@acquiringbank\"\n }\n\nIn case of a malformed request, you will receive the following response with\nan appropriate error message and error code: \n\n {\n \"error\": {\n \"code\": 400,\n \"status\": \"INVALID_ARGUMENT\",\n \"message\": \"MerchantInfo not present\"\n }\n }\n\n#### Malformed request error codes\n\n| Code | Title | Description |\n|------|-------------------|------------------------------------------|\n| 403 | PERMISSION_DENIED | The merchant is not authorized. |\n| 400 | INVALID_ARGUMENT | Request contains an invalid argument. |\n| 404 | NOT_FOUND | Request contains invalid transaction ID. |"]]