curl --request POST \
--url https://api.brazilpix.com/v2/withdrawals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pixKey": "12345678901",
"pixKeyType": "cpf",
"holderName": "João da Silva",
"holderDocument": "12345678901",
"holderDocumentType": "cpf",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 150.75,
"netAmount": 150,
"externalReference": "saque-empresa-001"
}
'import requests
url = "https://api.brazilpix.com/v2/withdrawals"
payload = {
"pixKey": "12345678901",
"pixKeyType": "cpf",
"holderName": "João da Silva",
"holderDocument": "12345678901",
"holderDocumentType": "cpf",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 150.75,
"netAmount": 150,
"externalReference": "saque-empresa-001"
}
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({
pixKey: '12345678901',
pixKeyType: 'cpf',
holderName: 'João da Silva',
holderDocument: '12345678901',
holderDocumentType: 'cpf',
projectId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: 150.75,
netAmount: 150,
externalReference: 'saque-empresa-001'
})
};
fetch('https://api.brazilpix.com/v2/withdrawals', 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.brazilpix.com/v2/withdrawals",
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([
'pixKey' => '12345678901',
'pixKeyType' => 'cpf',
'holderName' => 'João da Silva',
'holderDocument' => '12345678901',
'holderDocumentType' => 'cpf',
'projectId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => 150.75,
'netAmount' => 150,
'externalReference' => 'saque-empresa-001'
]),
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.brazilpix.com/v2/withdrawals"
payload := strings.NewReader("{\n \"pixKey\": \"12345678901\",\n \"pixKeyType\": \"cpf\",\n \"holderName\": \"João da Silva\",\n \"holderDocument\": \"12345678901\",\n \"holderDocumentType\": \"cpf\",\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 150.75,\n \"netAmount\": 150,\n \"externalReference\": \"saque-empresa-001\"\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.brazilpix.com/v2/withdrawals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pixKey\": \"12345678901\",\n \"pixKeyType\": \"cpf\",\n \"holderName\": \"João da Silva\",\n \"holderDocument\": \"12345678901\",\n \"holderDocumentType\": \"cpf\",\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 150.75,\n \"netAmount\": 150,\n \"externalReference\": \"saque-empresa-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brazilpix.com/v2/withdrawals")
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 \"pixKey\": \"12345678901\",\n \"pixKeyType\": \"cpf\",\n \"holderName\": \"João da Silva\",\n \"holderDocument\": \"12345678901\",\n \"holderDocumentType\": \"cpf\",\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 150.75,\n \"netAmount\": 150,\n \"externalReference\": \"saque-empresa-001\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": 150.75,
"feeAmount": 2.5,
"netAmount": 148.25,
"status": "completed",
"snapshotHolderName": "João da Silva",
"snapshotHolderDocument": "12345678901",
"createdAt": "2026-02-10T14:30:00.000Z",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"snapshotPixKey": "12345678901",
"snapshotPixKeyType": "cpf",
"failureReason": null,
"pspReference": null,
"processedAt": "2026-02-10T14:30:01.000Z",
"externalReference": "saque-empresa-001"
}{
"statusCode": 400,
"error": "BadRequest",
"message": "name must be longer than or equal to 2 characters",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "<string>"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Authentication token is required",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "<string>"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "You do not have permission to access this resource",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "<string>"
}{
"statusCode": 404,
"error": "NotFound",
"message": "Resource with id 550e8400-e29b-41d4-a716-446655440000 not found",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {
"resource": "Example",
"id": "550e8400-e29b-41d4-a716-446655440000"
},
"traceId": "<string>"
}{
"statusCode": 500,
"error": "InternalError",
"message": "An unexpected error occurred",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "2771463d58840c8e116dc6dda1e1e5d0"
}创建 PIX 提现
提供 PIX 密钥和收款账户持有人信息,创建一笔新的 PIX 提现。
所需权限: WITHDRAWAL:WRITE 或 FULL_ACCESS
IP 限制: 如果凭证配置了允许的 IP 列表,来自列表之外的请求将以 403 被拒绝。建议为拥有此权限的凭证配置。
curl --request POST \
--url https://api.brazilpix.com/v2/withdrawals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"pixKey": "12345678901",
"pixKeyType": "cpf",
"holderName": "João da Silva",
"holderDocument": "12345678901",
"holderDocumentType": "cpf",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 150.75,
"netAmount": 150,
"externalReference": "saque-empresa-001"
}
'import requests
url = "https://api.brazilpix.com/v2/withdrawals"
payload = {
"pixKey": "12345678901",
"pixKeyType": "cpf",
"holderName": "João da Silva",
"holderDocument": "12345678901",
"holderDocumentType": "cpf",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 150.75,
"netAmount": 150,
"externalReference": "saque-empresa-001"
}
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({
pixKey: '12345678901',
pixKeyType: 'cpf',
holderName: 'João da Silva',
holderDocument: '12345678901',
holderDocumentType: 'cpf',
projectId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amount: 150.75,
netAmount: 150,
externalReference: 'saque-empresa-001'
})
};
fetch('https://api.brazilpix.com/v2/withdrawals', 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.brazilpix.com/v2/withdrawals",
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([
'pixKey' => '12345678901',
'pixKeyType' => 'cpf',
'holderName' => 'João da Silva',
'holderDocument' => '12345678901',
'holderDocumentType' => 'cpf',
'projectId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amount' => 150.75,
'netAmount' => 150,
'externalReference' => 'saque-empresa-001'
]),
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.brazilpix.com/v2/withdrawals"
payload := strings.NewReader("{\n \"pixKey\": \"12345678901\",\n \"pixKeyType\": \"cpf\",\n \"holderName\": \"João da Silva\",\n \"holderDocument\": \"12345678901\",\n \"holderDocumentType\": \"cpf\",\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 150.75,\n \"netAmount\": 150,\n \"externalReference\": \"saque-empresa-001\"\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.brazilpix.com/v2/withdrawals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pixKey\": \"12345678901\",\n \"pixKeyType\": \"cpf\",\n \"holderName\": \"João da Silva\",\n \"holderDocument\": \"12345678901\",\n \"holderDocumentType\": \"cpf\",\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 150.75,\n \"netAmount\": 150,\n \"externalReference\": \"saque-empresa-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brazilpix.com/v2/withdrawals")
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 \"pixKey\": \"12345678901\",\n \"pixKeyType\": \"cpf\",\n \"holderName\": \"João da Silva\",\n \"holderDocument\": \"12345678901\",\n \"holderDocumentType\": \"cpf\",\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amount\": 150.75,\n \"netAmount\": 150,\n \"externalReference\": \"saque-empresa-001\"\n}"
response = http.request(request)
puts response.read_body{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"amount": 150.75,
"feeAmount": 2.5,
"netAmount": 148.25,
"status": "completed",
"snapshotHolderName": "João da Silva",
"snapshotHolderDocument": "12345678901",
"createdAt": "2026-02-10T14:30:00.000Z",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"snapshotPixKey": "12345678901",
"snapshotPixKeyType": "cpf",
"failureReason": null,
"pspReference": null,
"processedAt": "2026-02-10T14:30:01.000Z",
"externalReference": "saque-empresa-001"
}{
"statusCode": 400,
"error": "BadRequest",
"message": "name must be longer than or equal to 2 characters",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "<string>"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Authentication token is required",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "<string>"
}{
"statusCode": 403,
"error": "Forbidden",
"message": "You do not have permission to access this resource",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "<string>"
}{
"statusCode": 404,
"error": "NotFound",
"message": "Resource with id 550e8400-e29b-41d4-a716-446655440000 not found",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {
"resource": "Example",
"id": "550e8400-e29b-41d4-a716-446655440000"
},
"traceId": "<string>"
}{
"statusCode": 500,
"error": "InternalError",
"message": "An unexpected error occurred",
"timestamp": "2025-12-15T22:00:00.000Z",
"details": {},
"traceId": "2771463d58840c8e116dc6dda1e1e5d0"
}pending 或 processing)——最终结果始终通过 webhook 送达(withdrawal.completed 或 withdrawal.failed)。请以 webhook 为准;不要把创建接口的响应当作最终结果。校验错误(余额不足、超出限额、数据无效)会在调用本身直接返回错误。发送队列
提现被受理后,会进入向支付机构发送的队列。大多数情况下会立即发送;在交易高峰期可能需要几秒到几分钟,等待期间提现保持processing 状态。
- 按到达顺序。 提现按创建顺序依次发送。
- 不存在的密钥代价高昂。 每笔提现都会在 DICT 中查询目标 PIX 密钥,而巴西中央银行对这类查询设有限额——查询一个不存在的密钥所消耗的额度远高于一次成功的查询。当某个账户因密钥不存在或无效而累积多次拒绝时,其后续提现在队列中的优先级会降低,等待时间更长。请在发送前校验密钥,不要用提现来测试密钥是否存在。
- 密钥查询被暂停。 如果机构提示查询限额已用尽,尚未发送的提现将在队列中等待,直到恢复为止。已经发送的提现可能以
withdrawal_failed返回,金额退回余额。 - 最长期限。 6 小时内仍无法发送的提现将失败(
withdrawal_failed),预留金额退回余额。
授权
通过 POST /auth(client_id + client_secret)获取的访问令牌。有效期 300 秒。
请求头
由客户端生成的唯一键(8-255 个字符),使请求具备幂等性。使用相同键重试时返回缓存的响应(TTL 24 小时)。相同键但请求体不同时返回 422。
8 - 255执行操作的子账户的 reference。省略时,操作在主账户上执行;保留值 principal 同样解析为主账户,等同于省略该请求头。除 POST /auth 和 /sub-accounts 自身的端点(始终在主账户上操作)外,所有端点均接受该请求头。
可能的错误:404 SUB_ACCOUNT_NOT_FOUND、403 SUB_ACCOUNT_FORBIDDEN、403 SUB_ACCOUNT_SUSPENDED。
要求凭证已启用子账户访问(设置 → 集成 → API 凭证)。该项默认关闭,任何权限都无法替代,FULL_ACCESS 也不例外:未启用时响应为 403 SUB_ACCOUNT_FORBIDDEN。
^[a-z0-9][a-z0-9_-]{1,31}$"loja-centro"
请求体
创建 PIX 提现所需的数据。amount(从余额中扣除的总额)或 netAmount(收款人应收到的净额)只能提供其中一个。
收款人的 PIX 密钥。
"12345678901"
PIX 密钥类型。
cpf, cnpj, email, phone, random "cpf"
PIX 账户持有人姓名。
"João da Silva"
持有人的 CPF 或 CNPJ。
"12345678901"
持有人证件类型。
cpf, cnpj "cpf"
提现所属的项目 ID。如未提供且账户只有一个项目,提现将继承该项目;如有多个项目,提现将不关联任何项目——与创建 PIX 收款时的行为一致。
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
从余额中扣除的总额(BRL)。收款人收到 amount - feeAmount。最低 R$ 1,00。提供 amount 或 netAmount——不可同时提供。
x >= 1150.75
收款人应收到的净额(BRL)。API 会计算所需的总额(gross = netAmount + feeAmount)并从余额中扣除该总额。最低 R$ 1,00。提供 amount 或 netAmount——不可同时提供。
x >= 1150
您的外部参考 ID(可选)。会在响应以及 webhook withdrawal_completed 和 withdrawal_failed 中返回,便于与您的内部系统对账。
255"saque-empresa-001"
响应
提现创建成功
已创建的提现数据。
提现 ID
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
提现金额(BRL)
150.75
手续费金额(BRL)
2.5
净额(BRL)
148.25
提现状态
pending, processing, completed, failed "completed"
提现时的持有人姓名
"João da Silva"
提现时的持有人证件号
"12345678901"
创建时间
"2026-02-10T14:30:00.000Z"
提现所属的项目 ID(创建时未提供且账户有 2 个及以上项目时为 null)
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
提现时使用的 PIX 密钥
"12345678901"
提现时使用的 PIX 密钥类型
cpf, cnpj, email, phone, random "cpf"
失败原因(当 status = failed 时)
null
PSP(支付服务提供商)参考号
null
处理时间
"2026-02-10T14:30:01.000Z"
创建提现时发送的外部参考(可选)
"saque-empresa-001"