Cancel Charges
curl --request DELETE \
--url https://api.sandbox.wepayout.com.br/v2/payin/payments/request-multiple-cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
{}
]
}
'import requests
url = "https://api.sandbox.wepayout.com.br/v2/payin/payments/request-multiple-cancel"
payload = { "ids": [{}] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: [{}]})
};
fetch('https://api.sandbox.wepayout.com.br/v2/payin/payments/request-multiple-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.wepayout.com.br/v2/payin/payments/request-multiple-cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
[
]
]
]),
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.wepayout.com.br/v2/payin/payments/request-multiple-cancel"
payload := strings.NewReader("{\n \"ids\": [\n {}\n ]\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://api.sandbox.wepayout.com.br/v2/payin/payments/request-multiple-cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/payin/payments/request-multiple-cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"send": [32457, 32458, 32459],
"errors": {
"Charge status must be 'created' to be canceled": [32460, 32461],
"Charge not found": [32462]
}
}
{
"message": "The given data was invalid.",
"errors": {
"ids": [
"The ids field is required."
]
}
}
{
"message": "Unable to request the cancellation."
}
Charge
Cancel Charges
Request the cancellation of Payins by a list of IDs
DELETE
/
v2
/
payin
/
payments
/
request-multiple-cancel
Cancel Charges
curl --request DELETE \
--url https://api.sandbox.wepayout.com.br/v2/payin/payments/request-multiple-cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
{}
]
}
'import requests
url = "https://api.sandbox.wepayout.com.br/v2/payin/payments/request-multiple-cancel"
payload = { "ids": [{}] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: [{}]})
};
fetch('https://api.sandbox.wepayout.com.br/v2/payin/payments/request-multiple-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.wepayout.com.br/v2/payin/payments/request-multiple-cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
[
]
]
]),
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.wepayout.com.br/v2/payin/payments/request-multiple-cancel"
payload := strings.NewReader("{\n \"ids\": [\n {}\n ]\n}")
req, _ := http.NewRequest("DELETE", 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.delete("https://api.sandbox.wepayout.com.br/v2/payin/payments/request-multiple-cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/payin/payments/request-multiple-cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"send": [32457, 32458, 32459],
"errors": {
"Charge status must be 'created' to be canceled": [32460, 32461],
"Charge not found": [32462]
}
}
{
"message": "The given data was invalid.",
"errors": {
"ids": [
"The ids field is required."
]
}
}
{
"message": "Unable to request the cancellation."
}
Cancel Charges
Request the asynchronous cancellation of one or more Payins (billet or pix) by sending a list of their IDs.
This is an asynchronous request. A
202 Accepted response means the eligible charges were queued for cancellation, not that they were already canceled. Each eligible charge is processed by a background job.Eligibility
Cancellation Restrictions — an ID is only queued for cancellation when the charge:
- has
status = created - is of type
pixorbillet(credit-card charges are never eligible) - respects the minimum time since creation (see below)
errors; they are not canceled.Minimum Time Before Cancellation
- pix: at least 5 minutes after creation
- billet: at least 30 minutes after creation
Request Body
array
required
A list of Payin (charge) IDs to cancel.
- Minimum: 1 item
- Maximum: 200 items
[32457, 32458, 32459]Response
The response body is returned as-is (it does not use the standardstatus/data envelope).
array
The IDs that were accepted and queued for cancellation.
object
A map keyed by the reason an ID could not be queued, each pointing to the list of affected IDs (e.g. not found, wrong status, minimum time not met, not a pix/billet charge).
Request Example
curl --request DELETE \
--url https://api.sandbox.wepayout.com.br/v2/payin/payments/request-multiple-cancel \
--header 'Accept: application/json' \
--header 'Authorization: Bearer 123' \
--header 'Content-Type: application/json' \
--data '{
"ids": [32457, 32458, 32459]
}'
async function cancelCharges(ids) {
const response = await fetch(
'https://api.sandbox.wepayout.com.br/v2/payin/payments/request-multiple-cancel',
{
method: 'DELETE',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer 123',
'Content-Type': 'application/json'
},
body: JSON.stringify({ ids })
}
);
return await response.json();
}
// Usage — between 1 and 200 IDs
const ids = [32457, 32458, 32459];
const result = await cancelCharges(ids);
console.log('Cancellation result:', result);
import requests
def cancel_charges(ids):
url = 'https://api.sandbox.wepayout.com.br/v2/payin/payments/request-multiple-cancel'
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer 123',
'Content-Type': 'application/json'
}
data = {'ids': ids}
response = requests.delete(url, headers=headers, json=data)
return response.json()
# Usage — between 1 and 200 IDs
ids = [32457, 32458, 32459]
result = cancel_charges(ids)
print('Cancellation result:', result)
{
"send": [32457, 32458, 32459],
"errors": {
"Charge status must be 'created' to be canceled": [32460, 32461],
"Charge not found": [32462]
}
}
{
"message": "The given data was invalid.",
"errors": {
"ids": [
"The ids field is required."
]
}
}
{
"message": "Unable to request the cancellation."
}
Important Notes
Pix Cancellation: Pix charges are canceled instantly once the job runs.
Billet Cancellation: Billet charges require at least 1 day to move from
drop_requested to canceled, as the process depends on confirmation from the payment processor.Send between 1 and 200 IDs per request. To cancel every charge of a merchant within a date range, use Cancel Charges by Period instead.
Was this page helpful?
⌘I

