curl --request POST \
--url https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Customer asked to hold the payment"
}
'import requests
url = "https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel"
payload = { "reason": "Customer asked to hold the payment" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Customer asked to hold the payment'})
};
fetch('https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Customer asked to hold the payment'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel"
payload := strings.NewReader("{\n \"reason\": \"Customer asked to hold the payment\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Customer asked to hold the payment\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Customer asked to hold the payment\"\n}"
response = http.request(request)
puts response.read_body{
"status_code": 200,
"data": {
"payment_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "voided",
"failure_reason": "cancelled_by_platform",
"amount": 250,
"currency": "USD",
"intent_type": "payout"
},
"query_generated_time": 1712847600000
}{
"status_code": 409,
"data": {
"detail": "This payment can no longer be cancelled: it has already been sent to the bank, or it has already finished.",
"code": "payment_not_cancellable",
"error_code": 1117
},
"query_generated_time": 1750000000000
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Cancel a Payment
Withdraw a payment while it can still be taken back — before anything has been sent to the bank. Three moments qualify:
- it is parked for review (
pending_review); - it is approved but not yet executed (
pending); - it is
processingbut still queued on our side — for example a same-day payment created after the day’s last cutoff, waiting for the next window.
The funds return where they came from: a deposit’s expected credit is
cancelled, a payout’s reserved amount is released back to the wallet. The
payment ends voided with failure_reason: cancelled_by_platform, a
payment_intent.voided webhook is sent, and the payment is returned as
GET /platform/payments/{payment_id} shows it. Cancelling a payment you
already cancelled returns it again.
A payment that has already been sent, charged, settled or otherwise finished
is refused with payment_not_cancellable; reason says why (in_progress,
already_settled, …). Card payments have their own reversal paths and are
refused here.
curl --request POST \
--url https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "Customer asked to hold the payment"
}
'import requests
url = "https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel"
payload = { "reason": "Customer asked to hold the payment" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: 'Customer asked to hold the payment'})
};
fetch('https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Customer asked to hold the payment'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel"
payload := strings.NewReader("{\n \"reason\": \"Customer asked to hold the payment\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Customer asked to hold the payment\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.finogates.com/v1/platform/payments/{payment_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Customer asked to hold the payment\"\n}"
response = http.request(request)
puts response.read_body{
"status_code": 200,
"data": {
"payment_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "voided",
"failure_reason": "cancelled_by_platform",
"amount": 250,
"currency": "USD",
"intent_type": "payout"
},
"query_generated_time": 1712847600000
}{
"status_code": 409,
"data": {
"detail": "This payment can no longer be cancelled: it has already been sent to the bank, or it has already finished.",
"code": "payment_not_cancellable",
"error_code": 1117
},
"query_generated_time": 1750000000000
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Path Parameters
The payment to cancel.
Body
Optional body for POST /v1/platform/payments/{payment_id}/cancel.
Why you are cancelling, for your own records and ours. Optional.
255"Customer asked to hold the payment"
Response
Payment cancelled
Standard response wrapper for single-object responses and errors.
Generic over the payload type. A route that declares
CommonResponse[SomeModel] gets the real data schema rendered in
OpenAPI/Swagger; a bare CommonResponse leaves data untyped.

