# Google Pay response

The following are some of the fields contained in the Google Pay response.

| Field keys | Description |
|---|---|
| txnid | UPI transaction ID. **Deprecated** |
| responseCode | UPI response code. **Deprecated** |
| ApprovalRefNo | UPI approval reference number (optional).**Deprecated** |
| Status | Transaction status, will be {SUBMITTED/SUCCESS/FAILURE}. **Deprecated** |
| txnRef | Transaction reference ID (from input).**Deprecated** |
| tezResponse | A JSON string containing all response fields and some critical request fields. If the transaction is unsuccessful, some fields may not be set. Fields included are: - toVpa - VPA that receives money. - txnId - UPI transaction ID. - responseCode - UPI response code. - Status - Transaction status. - amount - Order amount. - txnRef - Transaction reference ID. <br /> The following example shows possible keys and values: {"Status":"SUCCESS","amount":"10.01","txnRef":"reference ID","toVpa":"test@axis","txnId":"AXI1234567890","responseCode":"00"}. This string is used for signing into the Google Pay Server and should be used for signature verification. |
| signature | The signature field is provided to verify the authenticity of a Google Pay response. It is the signed response from the Google Pay server. The signature exists if the payment is successful. If the payment fails, it may not exist. |
| signatureKeyId | The ID of the public key used for signature verification. |

The fields `txnId`,`responseCode`, `ApprovalRefNo`,`status`,`txnRef` are deprecated.
These fields are replaced with a field`tezResponse`.

## Handle Google Pay response

After you receive the Google Pay response, check the transaction ID against
the APIs provided by your payment service provider (PSP) or payment aggregators.
This is to ensure that the transaction is successful before you deliver the
goods or services.
**Important:** Checking the transaction against your PSP Bank is crucial to avoid fraud. Therefore, your server (not your mobile app or website) must check that Virtual Payment Address, transaction reference ID, and the expected amount for the purchased goods or services in the response are correct.

Google Pay provides a feature called [signature verification](https://developers.google.com/pay/india/api/web/sign-verify)
that lets you verify that the response is coming from Google Pay and that
it hasn't been modified. After you receive the response from Google Pay,
verify it with the signature.

- If the response status is submitted, check with your PSP or payment
  aggregator about the transaction status before processing the order.
  Note that the amount in the Google Pay response might not be the amount you
  requested, so you must use your requested amount for verification with your
  PSP or payment aggregator.

- If the response status is failure, you can either retry or abort. It is not
  required to send an additional PSP query.

## Handle the response code

If the payment doesn't go through, it won't be successful with the PSP.
Google Pay responses return a response code which can be used to improve the
payment flow. When the response code appears, you can either display the
corresponding error message to the user or implement a retry mechanism.

Based on our statistics, the response codes that appear most frequently are:

- `ZM`: Payment failure due to invalid MPIN.
- `Z9`: Payment failure due to insufficient funds.
- `91`: Payment failure due to transaction timeout or connection issue.

The three response codes above make up more than 50% of all payment failures.