- [HTTP request](https://developers.google.com/pay/carrier-wallets-v1/payment-integrator-carrier-wallets-api/cancelFundsReservation#body.HTTP_TEMPLATE)
- [Request body](https://developers.google.com/pay/carrier-wallets-v1/payment-integrator-carrier-wallets-api/cancelFundsReservation#body.request_body)
  - [JSON representation](https://developers.google.com/pay/carrier-wallets-v1/payment-integrator-carrier-wallets-api/cancelFundsReservation#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/pay/carrier-wallets-v1/payment-integrator-carrier-wallets-api/cancelFundsReservation#body.response_body)
- [CancelFundsReservationResponse](https://developers.google.com/pay/carrier-wallets-v1/payment-integrator-carrier-wallets-api/cancelFundsReservation#CancelFundsReservationResponse)
  - [JSON representation](https://developers.google.com/pay/carrier-wallets-v1/payment-integrator-carrier-wallets-api/cancelFundsReservation#CancelFundsReservationResponse.SCHEMA_REPRESENTATION)
- [CancelReservedFundsResult](https://developers.google.com/pay/carrier-wallets-v1/payment-integrator-carrier-wallets-api/cancelFundsReservation#CancelReservedFundsResult)
  - [JSON representation](https://developers.google.com/pay/carrier-wallets-v1/payment-integrator-carrier-wallets-api/cancelFundsReservation#CancelReservedFundsResult.SCHEMA_REPRESENTATION)

Initiates canceling the funds that were reserved by a `reserveFunds` call.

This cancels the pending transaction by freeing the reserved funds. The `reserveFundsRequestId` identifies which funds reservation is being canceled. When this is used, there is no money movement from a customer's account for this transaction. The `requestId` within the header is the idempotency key and uniquely identifies this transaction.

If the reservation of funds has expired or the payment integrator has automatically canceled the reservation, consider it a successful cancel rather than an error. Therefore, return a success result.

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

An example request looks like:


    {
      "requestHeader": {
        "protocolVersion": {
          "major": 1
        },
        "requestId": "G1NMPDFX4AW395L",
        "requestTimestamp": {
          "epochMillis": "1502220196077"
        },
        "paymentIntegratorAccountId": "SpeedyPaymentsIndia_INR"
      },
      "reserveFundsRequestId": "G1MQ0YERJ0Q7LPM"
    }

An example response looks like:


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

### HTTP request

`POST https://payment-integrator-carriers-api.google.com/integrator-base-path/carrier-wallets-v1/cancelFundsReservation`

### Request body

The request body contains data with the following structure:

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

| Fields ||
|---|---|
| `requestHeader` | ``object (`https://developers.google.com/pay/carrier-wallets-v1/payment-integrator-carrier-wallets-api/RequestHeader`)`` **REQUIRED**: Common header for all requests. |
| `reserveFundsRequestId` | `string` **REQUIRED** : `requestId` of the reserve funds call for this transaction. |

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

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

## CancelFundsReservationResponse

Response object for the cancel method.

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

| Fields ||
|---|---|
| `responseHeader` | ``object (`https://developers.google.com/pay/carrier-wallets-v1/payment-integrator-carrier-wallets-api/ResponseHeader`)`` **REQUIRED**: Common header for all responses. |
| `result` | ``object (`https://developers.google.com/pay/carrier-wallets-v1/payment-integrator-carrier-wallets-api/cancelFundsReservation#CancelReservedFundsResult`)`` **REQUIRED**: Result of this cancel. |

## CancelReservedFundsResult

The result of the `cancelFundsReservation` 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/carrier-wallets-v1/payment-integrator-carrier-wallets-api/Empty`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| **REQUIRED** : The result of the `cancelFundsReservation` 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/carrier-wallets-v1/payment-integrator-carrier-wallets-api/Empty`)`` Successful cancellation. |
| End of mutually exclusive fields. ||