Cancel Charges by Period
curl --request DELETE \
--url https://api.sandbox.wepayout.com.br/v2/payin/payments/request-cancel-by-period \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchant_id": 123,
"start_date": "<string>",
"end_date": "<string>",
"payment_method": [
{}
]
}
'import requests
url = "https://api.sandbox.wepayout.com.br/v2/payin/payments/request-cancel-by-period"
payload = {
"merchant_id": 123,
"start_date": "<string>",
"end_date": "<string>",
"payment_method": [{}]
}
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({
merchant_id: 123,
start_date: '<string>',
end_date: '<string>',
payment_method: [{}]
})
};
fetch('https://api.sandbox.wepayout.com.br/v2/payin/payments/request-cancel-by-period', 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-cancel-by-period",
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([
'merchant_id' => 123,
'start_date' => '<string>',
'end_date' => '<string>',
'payment_method' => [
[
]
]
]),
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-cancel-by-period"
payload := strings.NewReader("{\n \"merchant_id\": 123,\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"payment_method\": [\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-cancel-by-period")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_id\": 123,\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"payment_method\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/payin/payments/request-cancel-by-period")
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 \"merchant_id\": 123,\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"payment_method\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"estimated_total": 42
},
"message": "Cancellation requested successfully"
}
{
"status": false,
"message": "It is not possible to cancel payins with the applied filters."
}
{
"message": "The given data was invalid.",
"errors": {
"end_date": [
"The end date must be a date after start date."
]
}
}
Charge
Cancel Charges by Period
Request the cancellation of a merchant Payins created within a period
DELETE
/
v2
/
payin
/
payments
/
request-cancel-by-period
Cancel Charges by Period
curl --request DELETE \
--url https://api.sandbox.wepayout.com.br/v2/payin/payments/request-cancel-by-period \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchant_id": 123,
"start_date": "<string>",
"end_date": "<string>",
"payment_method": [
{}
]
}
'import requests
url = "https://api.sandbox.wepayout.com.br/v2/payin/payments/request-cancel-by-period"
payload = {
"merchant_id": 123,
"start_date": "<string>",
"end_date": "<string>",
"payment_method": [{}]
}
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({
merchant_id: 123,
start_date: '<string>',
end_date: '<string>',
payment_method: [{}]
})
};
fetch('https://api.sandbox.wepayout.com.br/v2/payin/payments/request-cancel-by-period', 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-cancel-by-period",
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([
'merchant_id' => 123,
'start_date' => '<string>',
'end_date' => '<string>',
'payment_method' => [
[
]
]
]),
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-cancel-by-period"
payload := strings.NewReader("{\n \"merchant_id\": 123,\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"payment_method\": [\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-cancel-by-period")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchant_id\": 123,\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"payment_method\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/payin/payments/request-cancel-by-period")
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 \"merchant_id\": 123,\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\",\n \"payment_method\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"data": {
"estimated_total": 42
},
"message": "Cancellation requested successfully"
}
{
"status": false,
"message": "It is not possible to cancel payins with the applied filters."
}
{
"message": "The given data was invalid.",
"errors": {
"end_date": [
"The end date must be a date after start date."
]
}
}
Cancel Charges by Period
Request the asynchronous cancellation of every eligible Payin created by a merchant within a date range, filtered by payment method. Useful when a merchant needs all of its open charges canceled at once (e.g. when the account is being deactivated).This is an asynchronous request. The response returns the estimated number of charges
that matched the filters and were queued for cancellation. The actual cancellation is performed
by background jobs.
Eligibility
Cancellation Restrictions — a charge is only queued for cancellation when it:
- has
status = created - was created between
start_dateandend_date - matches one of the requested
payment_methodvalues - respects the minimum time since creation (see below)
Minimum Time Before Cancellation
- pix: at least 5 minutes after creation
- billet: at least 30 minutes after creation
Request Body
integer
required
The ID of the merchant whose charges will be canceled. Must belong to the authenticated user.
string
required
Start of the creation period, format
Y-m-d H:i:s.Example: 2025-09-30 00:00:00string
required
End of the creation period, format
Y-m-d H:i:s. Must be after start_date.Example: 2025-12-31 00:00:00array
required
The payment methods to include in the cancellation. Must contain at least one value.Useful values:
pixbillet
The value
credit-card is accepted by validation but credit-card charges are never
eligible for cancellation, so including it has no effect.Response
boolean
Indicates if the cancellation request was successfully accepted.
object
Response data object.
Show Data
Show Data
integer
The estimated number of charges that matched the filters and were queued for cancellation.
string
Confirmation message about the cancellation request.
Request Example
curl --request DELETE \
--url https://api.sandbox.wepayout.com.br/v2/payin/payments/request-cancel-by-period \
--header 'Accept: application/json' \
--header 'Authorization: Bearer 123' \
--header 'Content-Type: application/json' \
--data '{
"merchant_id": 123,
"start_date": "2025-09-30 00:00:00",
"end_date": "2025-12-31 00:00:00",
"payment_method": ["pix", "billet"]
}'
async function cancelChargesByPeriod(payload) {
const response = await fetch(
'https://api.sandbox.wepayout.com.br/v2/payin/payments/request-cancel-by-period',
{
method: 'DELETE',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer 123',
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
}
);
return await response.json();
}
// Usage
const result = await cancelChargesByPeriod({
merchant_id: 123,
start_date: '2025-09-30 00:00:00',
end_date: '2025-12-31 00:00:00',
payment_method: ['pix', 'billet']
});
console.log('Cancellation result:', result);
import requests
def cancel_charges_by_period(payload):
url = 'https://api.sandbox.wepayout.com.br/v2/payin/payments/request-cancel-by-period'
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer 123',
'Content-Type': 'application/json'
}
response = requests.delete(url, headers=headers, json=payload)
return response.json()
# Usage
result = cancel_charges_by_period({
'merchant_id': 123,
'start_date': '2025-09-30 00:00:00',
'end_date': '2025-12-31 00:00:00',
'payment_method': ['pix', 'billet']
})
print('Cancellation result:', result)
{
"status": true,
"data": {
"estimated_total": 42
},
"message": "Cancellation requested successfully"
}
{
"status": false,
"message": "It is not possible to cancel payins with the applied filters."
}
{
"message": "The given data was invalid.",
"errors": {
"end_date": [
"The end date must be a date after start date."
]
}
}
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.To cancel a specific set of charges instead of a whole period, use Cancel Charges with a list of IDs.
Was this page helpful?
⌘I

