- [HTTP request](https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/asynchronousRefund#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/asynchronousRefund#body.request_body)
  - [JSON representation](https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/asynchronousRefund#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/asynchronousRefund#body.response_body)
- [AsynchronousRefundResponse](https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/asynchronousRefund#AsynchronousRefundResponse)
  - [JSON representation](https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/asynchronousRefund#AsynchronousRefundResponse.SCHEMA_REPRESENTATION)
- [AsynchronousRefundResult](https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/asynchronousRefund#AsynchronousRefundResult)
  - [JSON representation](https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/asynchronousRefund#AsynchronousRefundResult.SCHEMA_REPRESENTATION)

Refunds a portion or all of the transaction initiated through `https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/capture#google.standardpayments.flows.india_cards_funds_transfer.v1.PaymentIntegratorCardFundsTransferService.Capture`.

This initiates a request to refund funds that were captured. The amount refunded can be equal to or smaller than the remaining captured amount on the transaction. Multiple partial refunds are allowed by calling `india-cards-v1.asynchronousRefund` multiple times with different `requestId` within the header. The final result of the refund is supplied by a call to `refundResultNotification`. The `requestId` within the header is the idempotency key, which uniquely identifies this transaction.

If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type `https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/ErrorResponse`.

An example request looks like:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1
        },
        "requestId": "G18FCDTLD5B0SR4",
        "requestTimestamp": {
          "epochMillis": 1482489410000
        },
        "paymentIntegratorAccountId": "SpeedyPaymentsIndia_INR"
      },
      "captureRequestId": "G112YZH4XPDV88J",
      "refundAmount": {
        "amountMicros": "364000000",
        "currencyCode": "INR"
      }
    }

An example response looks like:


    {
      "responseHeader": {
        "responseTimestamp": {
          "epochMillis": 1482489412366
        }
      },
      "result": {
        "acknowledged": {}
      }
    }

### HTTP request

`POST https://www.integratorhost.example.com/integrator-base-path/v1/payment-integrator-authenticated-card-fop-api/asynchronousRefund`

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "requestHeader": { object (`https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/RequestHeader`) }, "captureRequestId": string, "refundAmount": { object (`https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/Amount`) } } ``` |

| Fields ||
|---|---|
| `requestHeader` | ``object (`https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/RequestHeader`)`` **REQUIRED**: Common header for all requests. |
| `captureRequestId` | `string` **REQUIRED** : A unique identifier for the capture to be refunded. This is the `requestId` generated by Google during the `captureFundsReservation` or `capture` which this request is associated with. |
| `refundAmount` | ``object (`https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/Amount`)`` **REQUIRED**: The amount of the refund. This will be a positive number, and should always be less-than or equal-to the remaining balance for the completed redirect payment. |

### 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/india-cards-v1/guides/connectivity/protocol-standards#http_status_codes).

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

## AsynchronousRefundResponse

Response object for the payment integrator hosted india-cards-v1.asynchronousRefund method.

| JSON representation |
|---|
| ``` { "responseHeader": { object (`https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/ResponseHeader`) }, "result": { object (`https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/asynchronousRefund#AsynchronousRefundResult`) } } ``` |

| Fields ||
|---|---|
| `responseHeader` | ``object (`https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/ResponseHeader`)`` **REQUIRED**: Common header for all responses. |
| `result` | ``object (`https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/asynchronousRefund#AsynchronousRefundResult`)`` **REQUIRED**: Result of this asynchronous refund. |

## AsynchronousRefundResult

Result of this asynchronous refund.

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

| Fields ||
|---|---|
| **REQUIRED**: The result of the refund. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `acknowledged` | ``object (`https://developers.google.com/pay/india-cards-v1/payment-integrator-india-cards-api/Empty`)`` Refund result notification was acknowledged. |
| End of mutually exclusive fields. ||