- [HTTP request](https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#body.request_body)
  - [JSON representation](https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#body.response_body)
- [RefundResult](https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#RefundResult)
  - [JSON representation](https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#RefundResult.SCHEMA_REPRESENTATION)
- [RefundResultNotificationResponse](https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#RefundResultNotificationResponse)
  - [JSON representation](https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#RefundResultNotificationResponse.SCHEMA_REPRESENTATION)
- [RefundResultNotificationResult](https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#RefundResultNotificationResult)
  - [JSON representation](https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#RefundResultNotificationResult.SCHEMA_REPRESENTATION)

Notify Google of the result of a refund after a `refund` method call has been made.

Refunds should be handled synchronously during the `refund` method call, but this method provides Google with a fast backup signal in case the synchronous call fails after it has performed the action but before it can return a result. This avoids the delay introduced by Google scheduling a retry for a future time.

The `refundResult` value is idempotent for this `refundRequestId`, so it's value can not 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/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-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/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-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/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/ErrorResponse).

An example request looks like:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 2
        },
        "requestId": "HsKv5pvtQKTtz7rdcw1YqE",
        "requestTimestamp": {
          "epochMillis": "1481852928293"
        },
        "paymentIntegratorAccountId": "InvisiCashUSA_USD"
      },
      "refundRequestId": "hH1T32PI86CpKwjuf6oD2r",
      "result": {
        "success": {}
      }
    }

An example response looks like:


    {
      "responseHeader": {
        "responseTimestamp": {
          "epochMillis": "1481855928376"
        }
      },
      "result": {
        "success": {}
      }
    }

### HTTP request

`POST https://vgw.googleapis.com/gsp/refundable-one-time-payment-code-v2/refundResultNotification/https://developers.google.com/pay/refundable-one-time-payment-code-v2/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/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/RequestHeader) }, "refundRequestId": string, "result": { object (`https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#RefundResult`) } } ``` |

| Fields ||
|---|---|
| `requestHeader` | `object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/RequestHeader)` **REQUIRED**: Common header for all requests. |
| `refundRequestId` | `string` **REQUIRED** : `requestId` of the `asynchronousRefund` call for this transaction. |
| `result` | ``object (`https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#RefundResult`)`` **REQUIRED**: Result of this refund. |

### 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/refundable-one-time-payment-code-v2/guides/connectivity/protocol-standards#http_status_codes).

| Possible response messages ||
|---|---|
| HTTP 200 Status | ``object (`https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#RefundResultNotificationResponse`)`` |
| HTTP 4XX / 5XX Status | `object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/ErrorResponse)` |
| End of mutually exclusive fields. ||

## RefundResult

Result codes for refunds.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "success": { object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/Empty) }, "accountClosed": { object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/AccountClosed) }, "accountClosedAccountTakenOver": { object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/refund#AccountClosedAccountTakenOver) }, "accountClosedFraud": { object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/refund#AccountClosedFraud) }, "accountOnHold": { object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/refund#AccountOnHold) }, "refundExceedsMaximumBalance": { object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/refund#RefundExceedsMaximumBalance) }, "refundWindowExceeded": { object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/refund#RefundWindowExceeded) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| **REQUIRED**: The result of this refund. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `success` | `object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/Empty)` Successful refund. |
| `accountClosed` | `object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/AccountClosed)` The account held with the integrator has been closed. 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. |
| `accountClosedAccountTakenOver` | `object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/refund#AccountClosedAccountTakenOver)` The user's account with the integrator has been closed, suspected account take over. 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. |
| `accountClosedFraud` | `object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/refund#AccountClosedFraud)` The user's account held with the integrator has been closed because of fraud. 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. |
| `accountOnHold` | `object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/refund#AccountOnHold)` The user's account is currently on hold and cannot accept the refund, but the user's account may later be able to accept the refund. Google may request another refund in the future, but will do so with a new `requestId`, so this request should be considered finished. |
| `refundExceedsMaximumBalance` | `object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/refund#RefundExceedsMaximumBalance)` The refund cannot be processed at the current time, because doing so would cause the user's balance to exceed the maximum allowed amount. Google may request another refund in the future, but will do so with a new `requestId`, so this request should be considered finished. |
| `refundWindowExceeded` | `object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/refund#RefundWindowExceeded)` The refund cannot be processed because the request is outside of the allowed refund period. |
| End of mutually exclusive fields. ||

## RefundResultNotificationResponse

Response object for the `refundResultNotification` method.

| JSON representation |
|---|
| ``` { "responseHeader": { object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/ResponseHeader) }, "result": { object (`https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#RefundResultNotificationResult`) } } ``` |

| Fields ||
|---|---|
| `responseHeader` | `object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/ResponseHeader)` **REQUIRED**: Common header for all responses. |
| `result` | ``object (`https://developers.google.com/pay/refundable-one-time-payment-code-v2/google-refundable-one-time-payment-code-api/refundResultNotification#RefundResultNotificationResult`)`` **REQUIRED**: Result of this call. |

## RefundResultNotificationResult

Result messages for the `refundResultNotification` method.

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "success": { object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/Empty) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| **REQUIRED** : The result of the `refundResultNotification` call. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `success` | `object (https://developers.google.com/pay/refundable-one-time-payment-code-v2/payment-integrator-refundable-one-time-payment-code-api/Empty)` Refund result notification was successful. |
| End of mutually exclusive fields. ||