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

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

An example request looks like:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1,
          "minor": 0,
          "revision": 0
        },
        "requestId": "G112YZH4XPDV88J",
        "requestTimestamp": "1481907920000"
      },
      "paymentIntegratorAccountId": "SpeedyPaymentsIndia_INR",
      "reserveFundsRequestId": "G1MQ0YERJ0Q7LPM",
      "amount": "728000000"
    }

An example response looks like:


    {
      "responseHeader": {
        "responseTimestamp": "1481907920760"
      },
      "result": "SUCCESS",
      "paymentIntegratorCaptureId": "invicash/ID::1323_abc"
    }

### HTTP request

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

### 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, "reserveFundsRequestId": string, "amount": 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**: This is the payment integrator account identifier that identifies contractual constraints around this transaction. |
| `reserveFundsRequestId` | `string` **REQUIRED** : `requestId` of the reserve funds call for this transaction. |
| `amount` | `string (https://developers.google.com/discovery/v1/type-format format)` **REQUIRED**: The amount of the purchase, in micros of the currency unit specified in the prior funds reservation. 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. |

### 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/payment-integrator-e-wallets-api/captureFundsReservation#CaptureFundsReservationResponse`)`` |
| HTTP 4XX / 5XX Status | ``object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/ErrorResponse`)`` |
| End of mutually exclusive fields. ||

## CaptureFundsReservationResponse

Response object for the capture method.

| JSON representation |
|---|
| ``` { "responseHeader": { object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/ResponseHeader`) }, "paymentIntegratorCaptureId": string, "result": enum (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/captureFundsReservation#CaptureReservedFundsResultCode`), "rawResult": { object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/RawResult`) } } ``` |

| Fields ||
|---|---|
| `responseHeader` | ``object (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/ResponseHeader`)`` **REQUIRED**: Common header for all responses. |
| `paymentIntegratorCaptureId` | `string` **REQUIRED**: This identifier is specific to the integrator and is generated by the integrator. This is the identifier that the integrator knows this capture by. For convenience, this identifier is included with in the remittance details |
| `result` | ``enum (`https://developers.google.com/pay/e-wallets-v1/payment-integrator-e-wallets-api/captureFundsReservation#CaptureReservedFundsResultCode`)`` **REQUIRED**: Result 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`. |

## CaptureReservedFundsResultCode

Result codes for capture.

| Enums ||
|---|---|
| `CAPTURE_RESERVED_FUNDS_RESULT_CODE_UNSPECIFIED` | Do not ever set this default value! |
| `SUCCESS` | Successful capture, deliver the goods. |
| `FUNDS_RESERVATION_EXPIRED` | The associated funds reservation has expired. |