- [HTTP request](https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/captureFundsReservation#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/captureFundsReservation#body.request_body)
  - [JSON representation](https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/captureFundsReservation#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/captureFundsReservation#body.response_body)
- [CaptureFundsReservationResponse](https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/captureFundsReservation#CaptureFundsReservationResponse)
  - [JSON representation](https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/captureFundsReservation#CaptureFundsReservationResponse.SCHEMA_REPRESENTATION)
- [CaptureReservedFundsResult](https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/captureFundsReservation#CaptureReservedFundsResult)
  - [JSON representation](https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/captureFundsReservation#CaptureReservedFundsResult.SCHEMA_REPRESENTATION)
- [FundsReservationExpired](https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/captureFundsReservation#FundsReservationExpired)
  - [JSON representation](https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/captureFundsReservation#FundsReservationExpired.SCHEMA_REPRESENTATION)

Initiates a capture of the funds reserved by a `reserveFunds` call.

This initiates money movement by capturing funds that were previous reserved in a call to `reserveFunds`. The `reserveFundsRequestId` specifies which funds reservation is to be captured. The amount captured can be less than or equal to the amount reserved but each reservation may only be captured once. The `requestId` within the header is the idempotency key and uniquely identifies this transaction. All mutations on this transaction (`refund`) populate the `requestId` value in their `transactionId` field.

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/carriers-v1/payment-integrator-carriers-api/ErrorResponse`.

An example request looks like:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1
        },
        "requestId": "G112YZH4XPDV88J",
        "requestTimestamp": {
          "epochMillis": "1502220196077"
        },
        "paymentIntegratorAccountId": "SpeedyPaymentsIndia_INR"
      },
      "reserveFundsRequestId": "G1MQ0YERJ0Q7LPM",
      "amount": {
        "amountMicros": "728000000",
        "currencyCode": "INR"
      },
      "tax": {
        "amountMicros": "27300000",
        "currencyCode": "INR"
      }
    }

An example response looks like:


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

### HTTP request

`POST https://www.integratorhost.example.com/integrator-base-path/carriers-v1/captureFundsReservation`

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "requestHeader": { object (`https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/RequestHeader`) }, "reserveFundsRequestId": string, "amount": { object (`https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/Amount`) }, "tax": { object (`https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/Amount`) } } ``` |

| Fields ||
|---|---|
| `requestHeader` | ``object (`https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/RequestHeader`)`` **REQUIRED**: Common header for all requests. |
| `reserveFundsRequestId` | `string` **REQUIRED** : `requestId` of the reserve funds call for this transaction. |
| `amount` | ``object (`https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/Amount`)`` **REQUIRED**: The amount of the purchase, including applicable taxes. This amount can be less than or equal to the amount specified in the prior funds reservation. An example situation when this would occur would be, if Google runs out of stock for one item in a an order with multiple items. |
| `tax` | ``object (`https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/Amount`)`` **REQUIRED**: The direct tax to the user for this transaction. This amount can be less than or equal to the tax amount specified in the prior funds reservation. |

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

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

## CaptureFundsReservationResponse

Response object for the capture method.

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

| Fields ||
|---|---|
| `responseHeader` | ``object (`https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/ResponseHeader`)`` **REQUIRED**: Common header for all responses. |
| `result` | ``object (`https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/captureFundsReservation#CaptureReservedFundsResult`)`` **REQUIRED**: Result of this capture. |

## CaptureReservedFundsResult

The result of the `captureFundsReservation` call.

| 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/carriers-v1/payment-integrator-carriers-api/Empty`) }, "fundsReservationExpired": { object (`https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/captureFundsReservation#FundsReservationExpired`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| **REQUIRED** : The result of the `captureFundsReservation` 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/carriers-v1/payment-integrator-carriers-api/Empty`)`` Successful capture, deliver the goods. |
| `fundsReservationExpired` | ``object (`https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/captureFundsReservation#FundsReservationExpired`)`` The associated funds reservation has expired. |
| End of mutually exclusive fields. ||

## FundsReservationExpired

The associated funds reservation has expired.

| JSON representation |
|---|
| ``` { "rawResult": { object (`https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/RawResult`) } } ``` |

| Fields ||
|---|---|
| `rawResult` | ``object (`https://developers.google.com/pay/carriers-v1/payment-integrator-carriers-api/RawResult`)`` **OPTIONAL** : Raw result of this event. 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. |