Cancel a Pix Automatic authorization
curl --request POST \
--url https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/cancelimport requests
url = "https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/cancel"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/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.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/cancel"
req, _ := http.NewRequest("POST", url, nil)
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.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/cancel")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "AUTOMATIC_PIX_PAYMENT_CANCEL_SAME_DATE",
"origin": "BANKING",
"message": "Cannot cancel a payment on or after its payment date"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "ACCOUNT_NOT_FOUND",
"origin": "BANKING",
"message": "Account not found"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "PIX_BILLING_AUTOMATIC_NOT_CANCELABLE",
"origin": "BANKING",
"message": "Automatic Pix Request 2d902e74-7ca0-4f6c-9c83-4b5e6f708192 is not in a valid state to be canceled"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BAD_REQUEST",
"origin": "BANKING",
"message": "Bad Request: Your request is invalid or incomplete. Please make sure you are requesting with the right fields.",
"fields": [
{
"field": "organizationId",
"message": "Invalid UUID",
"code": "ORGANIZATIONID_UUID"
}
]
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "CONNECTION_ERROR",
"origin": "BANKING",
"message": "There was a connection error"
}Cancel a Pix Automatic authorization
Cancels a Pix Automático authorization: the payer can no longer grant it, and no further charge is made.
POST
/
realms
/
{realmId}
/
organizations
/
{organizationId}
/
accounts
/
{accountId}
/
wallets
/
{walletId}
/
pix-billing-automatic
/
{pixBillingAutomaticId}
/
cancel
Cancel a Pix Automatic authorization
curl --request POST \
--url https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/cancelimport requests
url = "https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/cancel"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/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.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/cancel"
req, _ := http.NewRequest("POST", url, nil)
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.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/cancel")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/pix-billing-automatic/{pixBillingAutomaticId}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "AUTOMATIC_PIX_PAYMENT_CANCEL_SAME_DATE",
"origin": "BANKING",
"message": "Cannot cancel a payment on or after its payment date"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "ACCOUNT_NOT_FOUND",
"origin": "BANKING",
"message": "Account not found"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "PIX_BILLING_AUTOMATIC_NOT_CANCELABLE",
"origin": "BANKING",
"message": "Automatic Pix Request 2d902e74-7ca0-4f6c-9c83-4b5e6f708192 is not in a valid state to be canceled"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BAD_REQUEST",
"origin": "BANKING",
"message": "Bad Request: Your request is invalid or incomplete. Please make sure you are requesting with the right fields.",
"fields": [
{
"field": "organizationId",
"message": "Invalid UUID",
"code": "ORGANIZATIONID_UUID"
}
]
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "CONNECTION_ERROR",
"origin": "BANKING",
"message": "There was a connection error"
}The authorization moves to
CANCELED, and so do its charges still CREATED or SCHEDULED — the ones already sent to the payer’s bank are canceled there first; paid, failed and expired charges keep their status. A charge already sent to the payer’s bank can’t be canceled on or after its date. Canceling an authorization that is already CANCELED, REVOKED or EXPIRED changes nothing and also answers 204.
While the payer is in the middle of granting it, it can’t be canceled: try again in a few minutes. If canceling one of its charges at the payer’s bank fails, the authorization is already CANCELED and the answer is that failure; that charge keeps its status, and calling again answers 204 without retrying it. Check schedules with GET .../pix-billing-automatic/{pixBillingAutomaticId}.
Use default as walletId for the organization’s main wallet. Any member of the organization can cancel one.Headers
Environment of the authorization: LIVE (production) or TEST (sandbox). When you omit it, TEST is used; any other value is rejected.
Available options:
LIVE, TEST Path Parameters
ID of your realm.
Format: UUID
ID of the organization.
Format: UUID
ID of the organization's account (24 hexadecimal characters).
Pattern:
^[0-9a-fA-F]{24}$ID of the wallet that receives the payments (24 hexadecimal characters), or default for the organization's main wallet.
Pattern:
^([0-9a-fA-F]{24}|default)$ID of the authorization — its _id (24 hexadecimal characters).
Pattern:
^[0-9a-fA-F]{24}$Response
No Content. The operation succeeded and the response has no body.