- [HTTP request](https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#body.request_body)
  - [JSON representation](https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#body.response_body)
- [CaptureResult](https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#CaptureResult)
  - [JSON representation](https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#CaptureResult.SCHEMA_REPRESENTATION)
- [CaptureResultCode](https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#CaptureResultCode)
- [CaptureResultNotificationResponse](https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#CaptureResultNotificationResponse)
  - [JSON representation](https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#CaptureResultNotificationResponse.SCHEMA_REPRESENTATION)
- [CaptureResultNotificationResultCode](https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#CaptureResultNotificationResultCode)

Notify Google of the result of a capture after a `capture` or `asynchronousCapture` method call has been made.

The `captureResult` value is idempotent for this `captureRequestId`, so its value cannot be changed by a subsequent call to this method.

If the endpoint encounters an error while processing the request, the endpoint will return HTTP 4xx or 5xx and the HTTP body will either be of type [`ErrorResponse`](https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/ErrorResponse) or contain a generic error (e.g. a message similar to "There was an error. Please try again later.").

The generic error is used in situations where an [`ErrorResponse`](https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/ErrorResponse) with a clear description could be used to help an attacker understand the payment integrator account identifier of other integrators. In these situations, where either the signing key doesn't match, the payment integrator identifier was not found, or the encryption key was unknown, this method will return a generic error. If the request signature could be verified, additional information regarding the error will be returned in an [`ErrorResponse`](https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/ErrorResponse).

An example request looks like:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1,
          "minor": 1,
          "revision": 0
        },
        "requestId": "KcgwSKrV76eVNDUbsZ4UA3",
        "requestTimestamp": "1481852928293"
      },
      "paymentIntegratorAccountId": "InvisiCashUSA_USD",
      "captureRequestId": "awNaC510cefae3IJdNEvW2",
      "captureResult": {
        "captureResultCode": "SUCCESS"
      }
    }

An example response looks like:


    {
      "responseHeader": {
        "responseTimestamp": "1481852928324"
      },
      "result": "SUCCESS"
    }

### HTTP request

`POST https://vgw.googleapis.com/gsp/e-wallets-v1/captureResultNotification/https://developers.google.com/pay/e-wallets-v1/reference/glossary#payment_integrator_account_id`

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "requestHeader": { object (https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/RequestHeader) }, "paymentIntegratorAccountId": string, "captureRequestId": string, "captureResult": { object (`https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#CaptureResult`) }, "paymentIntegratorTransactionId": string } ``` |

| Fields ||
|---|---|
| `requestHeader` | `object (https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/RequestHeader)` **REQUIRED**: Common header for all requests. |
| `paymentIntegratorAccountId` | `string` **REQUIRED**: Payment integrator account identifier on which the capture occurred. |
| `captureRequestId` | `string` **REQUIRED** : A unique identifier for this transaction. This is the `requestId` generated by Google during the `capture` or `asynchronousCapture` call which this request is associated with. This is a string with a max length of 100 characters and contains only the characters "a-z", "A-Z", "0-9", ":", "-", and "_". |
| `captureResult` | ``object (`https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#CaptureResult`)`` **REQUIRED**: Result of this capture. |
| `paymentIntegratorTransactionId` | `string` **OPTIONAL**: This identifier is specific to the integrator and is generated by the integrator. This is the identifier that the integrator knows this transaction by. For convenience, this identifier is included with in the remittance details |

### Response body

This method supports multiple return types. For additional information about what 4XX or 5XX HTTP status code to return with an `ErrorResponse`, consult the `ErrorResponse` object and [HTTP status codes documentation](https://developers.google.com/pay/e-wallets-v1/guides/connectivity/protocol-standards#http_status_codes).

| Possible response messages ||
|---|---|
| HTTP 200 Status | ``object (`https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#CaptureResultNotificationResponse`)`` |
| HTTP 4XX / 5XX Status | `object (https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/ErrorResponse)` |
| End of mutually exclusive fields. ||

## CaptureResult

Information about the final result of a capture.

| JSON representation |
|---|
| ``` { "captureResultCode": enum (`https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#CaptureResultCode`), "rawResult": { object (https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/RawResult) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "transactionMaxLimit": string, "transactionMinLimit": string, "currentBalance": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `captureResultCode` | ``enum (`https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#CaptureResultCode`)`` **REQUIRED**: Result code of this capture. |
| `rawResult` | `object (https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/RawResult)` **OPTIONAL** : Raw result of this capture. Used to help inform Google's risk engine and analytics. In decline code--mapping situations, data is sometimes lost. The integrator can choose to give Google a raw code. For example, a credit card gateway (the integrator) may use this field to communicate to Google the exact decline code that was received from the VISA network. In that case, the `scope` would be "visa" and the `rawCode` would be whatever the VISA network returned. This value is **required** if the `result` is not `SUCCESS`. |
| **OPTIONAL**: Details related to the capture failure. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `transactionMaxLimit` | `string (https://developers.google.com/discovery/v1/type-format format)` If `captureResultCode` is `CHARGE_EXCEEDS_TRANSACTION_LIMIT` then this is the value of the maximum allowable transaction. This is used for structured, user facing messaging and decline rate analysis. This amount is [micros](https://developers.google.com/pay/e-wallets-v1/reference/glossary#micros "What are micros?") of the same `currencyCode` as the original `capture` or `asynchronousCapture` method call. |
| `transactionMinLimit` | `string (https://developers.google.com/discovery/v1/type-format format)` If `captureResultCode` is `CHARGE_UNDER_TRANSACTION_LIMIT` then this is the value of the minimum allowable transaction. This is used for structured, user facing messaging and decline rate analysis. This amount is [micros](https://developers.google.com/pay/e-wallets-v1/reference/glossary#micros "What are micros?") of the same `currencyCode` as the original `capture` or `asynchronousCapture` method call. |
| `currentBalance` | `string (https://developers.google.com/discovery/v1/type-format format)` If Result is `INSUFFICIENT_FUNDS`, then this is the current available balance in the user's account (in [micros](https://developers.google.com/pay/e-wallets-v1/reference/glossary#micros "What are micros?")). This is used for structured, user facing messaging. This value must be in the same currency as the `currencyCode` on the request. |
| End of mutually exclusive fields. ||

## CaptureResultCode

Result codes for a capture.

| Enums ||
|---|---|
| `UNKNOWN_RESULT` | Do not ever set this default value! |
| `SUCCESS` | Capture successful. |
| `CHARGE_UNDER_TRANSACTION_LIMIT` | Requested capture amount does not meet the integrator's minimum per-transaction amount. If this code is used, populate the `transactionMinLimit` field with the minimum transaction amount for user messaging purposes. |
| `CHARGE_EXCEEDS_TRANSACTION_LIMIT` | Requested capture amount exceeds the integrator's maximum per-transaction limit. If this code is used, populate the `transactionMaxLimit` field with the transaction limit for user messaging purposes. |
| `CHARGE_EXCEEDS_DAILY_LIMIT` | User's account cannot be used for purchases right now as it has exceeded its daily limit. |
| `CHARGE_EXCEEDS_MONTHLY_LIMIT` | User's account cannot be used for purchases right now as it has exceeded its monthly limit. |
| `INSUFFICIENT_FUNDS` | This account does not have sufficient funds to guarantee this capture. |
| `SUSPECTED_FRAUD` | The integrator has reason to suspect that this transaction is fraudulent. |
| `ACCOUNT_CLOSED` | User's account held with the integrator has been closed. This return value will cause the user's instrument to be closed with Google. The user will be forced to add a new instrument. |
| `ACCOUNT_CLOSED_ACCOUNT_TAKEN_OVER` | User's account with the integrator has been closed, suspected account take over. This return value will cause the user's instrument to be closed with Google. The user will be forced to add a new instrument. |
| `ACCOUNT_CLOSED_FRAUD` | User's account held with the integrator has been closed because of fraud. This return value will cause the user's instrument to be closed with Google. The user will be forced to add a new instrument. |
| `ACCOUNT_ON_HOLD` | User's account is on hold. |
| `OTP_NOT_MATCHED` | OTP did not match what the integrator sent. |
| `OTP_ALREADY_USED` | OTP was already used. |
| `CAPTURE_REQUEST_EXPIRED` | It took too long for the integrator to capture the user's funds. Google will treat this decline as a final state, so the integrator must ensure that the user's funds do not get captured later or that the user gets automatically refunded if the capture ended up succeeding. |
| `INVALID_PIN` | The user supplied an invalid PIN. |
| `OS_LOCK_FAILED` | This payment flow requires an OS lock challenge and the user failed to unlock the device. |
| `PIN_ENTRY_ATTEMPTS_EXHAUSTED` | This payment flow requires user PIN entry. The user failed PIN entry enough times that they ran out of retries. |
| `USER_EXITED_PAYMENT_FLOW` | User canceled the whole payment attempt (either at the OS lock or at the PIN entry screen). |
| `MONTHLY_FREQUENCY_LIMIT_EXCEEDED` | User's account cannot be used for purchases right now as it has exceeded its monthly transaction attempt limit. |
| `DECLINED_BY_ISSUER` | This decline code should never be used in steady-state. It is meant as a temporary catch-all code to use when the integrator encounters an unknown decline code from the underlying issuer of the user's instrument. This result code can be used while the integrator determines a more appropriate result code to use or negotiates the addition of a new result code to this specification. Importantly, this decline code is very much a *real* decline. It is a permanent decline as far as Google is concerned. If the integrator returns this, it is up to them to track down what the issuer's code really means and refund the user if it turns out the code actually meant `SUCCESS`. If this decline code is used for the same underlying decline code for more than a certain number of days, Google will treat it as a bug and track it accordingly with respect to any contractual penalties around fixing bugs. <br /> > [!NOTE] > **Note:** even after the integrator maps the unknown issuer decline code to an appropriate result code going forward, it is important that they still return `DECLINED_BY_ISSUER` idempotently for any capture request that was originally declined with a `DECLINED_BY_ISSUER` result. > <br /> |
| `GOOGLE_PAYMENT_TOKEN_INVALIDATED_BY_USER` | The account is active, but the GPT has been invalidated by the user on the integrator's side. Returning this value will cause the user's instrument to be closed with Google. The user will be forced to add a new instrument by going through the association flow again. |
| `PAYMENT_CANCELLED_BY_THE_USER` | The user cancelled the payment on the issuer app or interface. |
| `ENROLLMENT_CANCELLED_BY_THE_USER` | The user cancelled the mandate enrollment on the issuer app or interface. |

## CaptureResultNotificationResponse

Response object for the `captureResultNotification` method.

| JSON representation |
|---|
| ``` { "responseHeader": { object (https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/ResponseHeader) }, "result": enum (`https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#CaptureResultNotificationResultCode`) } ``` |

| Fields ||
|---|---|
| `responseHeader` | `object (https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/ResponseHeader)` **REQUIRED**: Common header for all responses. |
| `result` | ``enum (`https://developers.google.com/pay/e-wallets-v1/google-e-wallets-api/captureResultNotification#CaptureResultNotificationResultCode`)`` **REQUIRED**: Result of this call. |

## CaptureResultNotificationResultCode

Result codes for the `captureResultNotification` method.

| Enums ||
|---|---|
| `UNKNOWN_RESULT` | Do not ever set this default value! |
| `SUCCESS` | Capture result notification was successfully processed. |