Cancel a Batch
Cancel a batch before processing begins. Valid from uploaded,
validating, validated, validation_failed, or confirmed. Once
processing begins, use per-payout cancellation instead.
POST
/
v1
/
batches
/
{id}
/
cancel
Cancel a batch
curl --request POST \
--url https://api.antonpayments.com/v1/batches/{id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'DPoP: <api-key>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
DPoP: '<api-key>'
}
};
fetch('https://api.antonpayments.com/v1/batches/{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.antonpayments.com/v1/batches/{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_HTTPHEADER => [
"Authorization: Bearer <token>",
"DPoP: <api-key>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.antonpayments.com/v1/batches/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("DPoP", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"id": "bat_01HX8Z9K0M2N3P4Q5R6S7T8UBT",
"merchant_id": "<string>",
"uploaded_by": "<string>",
"status": "uploaded",
"file_name": "payroll_2026_04_15.csv",
"file_format": "csv",
"file_size": 123,
"created_at": "2026-04-15T14:30:00Z",
"updated_at": "2026-04-15T14:30:00Z",
"total_rows": 123,
"valid_rows": 123,
"invalid_rows": 123,
"warning_rows": 123,
"skipped_rows": 123,
"processed_rows": 123,
"summary": {
"new_beneficiaries": 123,
"matched_beneficiaries": 123,
"existing_beneficiaries": 123,
"methods": {},
"estimated_debits": [
{
"currency": "USD",
"amount": "1234.56",
"fx_rows": 123,
"same_currency_rows": 123,
"rate_timestamp": "2026-04-15T14:30:00Z"
}
],
"fx_markup_bps": 123,
"balance_check": {}
},
"source_currency": "USD",
"total_amount": "12345.67",
"total_currency": "USD",
"current_row_index": 123,
"expires_at": "2026-04-15T14:30:00Z",
"confirmed_at": "2026-04-15T14:30:00Z",
"confirmed_by": "<string>",
"cancelled_at": "2026-04-15T14:30:00Z",
"cancelled_by": "<string>",
"processing_started_at": "2026-04-15T14:30:00Z",
"completed_at": "2026-04-15T14:30:00Z"
}
}Authorizations
Headers
Was this page helpful?
⌘I
Cancel a batch
curl --request POST \
--url https://api.antonpayments.com/v1/batches/{id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'DPoP: <api-key>' \
--header 'Idempotency-Key: <idempotency-key>'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
DPoP: '<api-key>'
}
};
fetch('https://api.antonpayments.com/v1/batches/{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.antonpayments.com/v1/batches/{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_HTTPHEADER => [
"Authorization: Bearer <token>",
"DPoP: <api-key>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.antonpayments.com/v1/batches/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("DPoP", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"id": "bat_01HX8Z9K0M2N3P4Q5R6S7T8UBT",
"merchant_id": "<string>",
"uploaded_by": "<string>",
"status": "uploaded",
"file_name": "payroll_2026_04_15.csv",
"file_format": "csv",
"file_size": 123,
"created_at": "2026-04-15T14:30:00Z",
"updated_at": "2026-04-15T14:30:00Z",
"total_rows": 123,
"valid_rows": 123,
"invalid_rows": 123,
"warning_rows": 123,
"skipped_rows": 123,
"processed_rows": 123,
"summary": {
"new_beneficiaries": 123,
"matched_beneficiaries": 123,
"existing_beneficiaries": 123,
"methods": {},
"estimated_debits": [
{
"currency": "USD",
"amount": "1234.56",
"fx_rows": 123,
"same_currency_rows": 123,
"rate_timestamp": "2026-04-15T14:30:00Z"
}
],
"fx_markup_bps": 123,
"balance_check": {}
},
"source_currency": "USD",
"total_amount": "12345.67",
"total_currency": "USD",
"current_row_index": 123,
"expires_at": "2026-04-15T14:30:00Z",
"confirmed_at": "2026-04-15T14:30:00Z",
"confirmed_by": "<string>",
"cancelled_at": "2026-04-15T14:30:00Z",
"cancelled_by": "<string>",
"processing_started_at": "2026-04-15T14:30:00Z",
"completed_at": "2026-04-15T14:30:00Z"
}
}