Method: cancelFundsReservation
Stay organized with collections
Save and categorize content based on your preferences.
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 final result of the cancel is supplied by a call to cancelFundsReservationResultNotification
. 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 an ACKNOWLEDGED response code and call cancelFundsReservationResultNotification
.
If the endpoint encounters an error while processing the request, the response body from this endpoint should be of type 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://www.integratorhost.example.com/integrator-base-path/carriers-v1/cancelFundsReservation
Request body
The request body contains data with the following structure:
JSON representation |
{
"requestHeader": {
object (RequestHeader )
},
"reserveFundsRequestId": string
} |
Fields |
requestHeader |
object (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.
Possible response messages |
HTTP 200 Status |
object (CancelFundsReservationResponse )
|
HTTP 4XX / 5XX Status |
object (ErrorResponse )
|
CancelFundsReservationResponse
Response object for the cancel method.
CancelReservedFundsResult
The result of the cancelFundsReservation
call.
JSON representation |
{
// Union field result can be only one of the following:
"success": {
object (Empty )
}
// End of list of possible types for union field result .
} |
Fields |
Union field result . REQUIRED: The result of the cancelFundsReservation call. result can be only one of the following: |
success |
object (Empty )
Successful cancellation.
|
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-29 UTC."],[[["\u003cp\u003eInitiates canceling reserved funds, freeing them without money movement and requiring a \u003ccode\u003ecancelFundsReservationResultNotification\u003c/code\u003e call for the final result.\u003c/p\u003e\n"],["\u003cp\u003eUses \u003ccode\u003ereserveFundsRequestId\u003c/code\u003e to identify the reservation being canceled and the combination of \u003ccode\u003erequestId\u003c/code\u003e and \u003ccode\u003epaymentIntegratorAccountId\u003c/code\u003e as the idempotency key.\u003c/p\u003e\n"],["\u003cp\u003eIn cases of expiration or automatic cancellation by the payment integrator, treat it as a successful cancel and proceed with \u003ccode\u003ecancelFundsReservationResultNotification\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAn \u003ccode\u003eErrorResponse\u003c/code\u003e is returned for processing errors, with specific HTTP status codes for different error scenarios.\u003c/p\u003e\n"],["\u003cp\u003eThe request body includes \u003ccode\u003erequestHeader\u003c/code\u003e with protocol version, requestId, timestamp, and paymentIntegratorAccountId, along with \u003ccode\u003ereserveFundsRequestId\u003c/code\u003e for identifying the funds to cancel.\u003c/p\u003e\n"]]],["This describes the `cancelFundsReservation` process, initiated via a POST request. The request includes a header with `requestId` and `paymentIntegratorAccountId` for idempotency, along with the `reserveFundsRequestId`. A successful cancel, even if previously expired, returns an `ACKNOWLEDGED` response code and triggers a `cancelFundsReservationResultNotification`. The response body confirms success or returns an `ErrorResponse` and contains a response header and a `result` field that returns `success`.\n"],null,["# Method: cancelFundsReservation\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [CancelFundsReservationResponse](#CancelFundsReservationResponse)\n - [JSON representation](#CancelFundsReservationResponse.SCHEMA_REPRESENTATION)\n- [CancelReservedFundsResult](#CancelReservedFundsResult)\n - [JSON representation](#CancelReservedFundsResult.SCHEMA_REPRESENTATION)\n\nInitiates canceling the funds that were reserved by a `reserveFunds` call.\n\nThis 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 final result of the cancel is supplied by a call to `cancelFundsReservationResultNotification`. The `requestId` within the header is the idempotency key and uniquely identifies this transaction.\n\nIf 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 an ACKNOWLEDGED response code and call `cancelFundsReservationResultNotification`.\n\nIf the endpoint encounters an error while processing the request, the response body from this endpoint should be of type [`ErrorResponse`](/pay/carriers-v1/payment-integrator-carriers-api/ErrorResponse).\n\nAn example request looks like: \n\n\n {\n \"requestHeader\": {\n \"protocolVersion\": {\n \"major\": 1\n },\n \"requestId\": \"G1NMPDFX4AW395L\",\n \"requestTimestamp\": {\n \"epochMillis\": \"1502220196077\"\n },\n \"paymentIntegratorAccountId\": \"SpeedyPaymentsIndia_INR\"\n },\n \"reserveFundsRequestId\": \"G1MQ0YERJ0Q7LPM\"\n }\n\nAn example response looks like: \n\n\n {\n \"responseHeader\": {\n \"responseTimestamp\": {\n \"epochMillis\": \"1481907920760\"\n }\n },\n \"result\": {\n \"success\": {}\n }\n }\n\n### HTTP request\n\n`POST https://www.integratorhost.example.com/integrator-base-path/carriers-v1/cancelFundsReservation`\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"requestHeader\": { object (/pay/carriers-v1/payment-integrator-carriers-api/RequestHeader) }, \"reserveFundsRequestId\": string } ``` |\n\n| Fields ||\n|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n| `requestHeader` | `object (`[RequestHeader](/pay/carriers-v1/payment-integrator-carriers-api/RequestHeader)`)` **REQUIRED**: Common header for all requests. |\n| `reserveFundsRequestId` | `string` **REQUIRED** : `requestId` of the reserve funds call for this transaction. |\n\n### Response body\n\nThis 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](/pay/carriers-v1/guides/connectivity/protocol-standards#http_status_codes).\n\n| Possible response messages ||\n|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|\n| HTTP 200 Status | `object (`[CancelFundsReservationResponse](/pay/carriers-v1/payment-integrator-carriers-api/cancelFundsReservation#CancelFundsReservationResponse)`)` |\n| HTTP 4XX / 5XX Status | `object (`[ErrorResponse](/pay/carriers-v1/payment-integrator-carriers-api/ErrorResponse)`)` |\n\nCancelFundsReservationResponse\n------------------------------\n\nResponse object for the cancel method.\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"responseHeader\": { object (/pay/carriers-v1/payment-integrator-carriers-api/ResponseHeader) }, \"result\": { object (/pay/carriers-v1/payment-integrator-carriers-api/cancelFundsReservation#CancelReservedFundsResult) } } ``` |\n\n| Fields ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `responseHeader` | `object (`[ResponseHeader](/pay/carriers-v1/payment-integrator-carriers-api/ResponseHeader)`)` **REQUIRED**: Common header for all responses. |\n| `result` | `object (`[CancelReservedFundsResult](/pay/carriers-v1/payment-integrator-carriers-api/cancelFundsReservation#CancelReservedFundsResult)`)` **REQUIRED**: Result of this cancel. |\n\nCancelReservedFundsResult\n-------------------------\n\nThe result of the `cancelFundsReservation` call.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { // Union field `result` can be only one of the following: \"success\": { object (/pay/carriers-v1/payment-integrator-carriers-api/Empty) } // End of list of possible types for union field `result`. } ``` |\n\n| Fields ||\n|-----------|-------------------------------------------------------------------------------------------------------|\n| Union field `result`. **REQUIRED** : The result of the `cancelFundsReservation` call. `result` can be only one of the following: ||\n| `success` | `object (`[Empty](/pay/carriers-v1/payment-integrator-carriers-api/Empty)`)` Successful cancellation. |"]]