Solicitar um saque
curl --request POST \
--url https://api.zynpay.com.br/v1/public/pix/withdrawals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"amountCents": 50000,
"pixKey": "12345678909"
}
'import requests
url = "https://api.zynpay.com.br/v1/public/pix/withdrawals"
payload = {
"amountCents": 50000,
"pixKey": "12345678909"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amountCents: 50000, pixKey: '12345678909'})
};
fetch('https://api.zynpay.com.br/v1/public/pix/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.zynpay.com.br/v1/public/pix/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([
'amountCents' => 50000,
'pixKey' => '12345678909'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zynpay.com.br/v1/public/pix/withdrawals"
payload := strings.NewReader("{\n \"amountCents\": 50000,\n \"pixKey\": \"12345678909\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.zynpay.com.br/v1/public/pix/withdrawals")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amountCents\": 50000,\n \"pixKey\": \"12345678909\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zynpay.com.br/v1/public/pix/withdrawals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountCents\": 50000,\n \"pixKey\": \"12345678909\"\n}"
response = http.request(request)
puts response.read_body{
"withdrawal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "requested",
"amountCents": 123,
"feeCents": 123,
"netAmountCents": 123,
"createdAt": "2023-11-07T05:31:56Z",
"reason": "<string>",
"paidAt": "2023-11-07T05:31:56Z"
}
}{
"withdrawal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "requested",
"amountCents": 123,
"feeCents": 123,
"netAmountCents": 123,
"createdAt": "2023-11-07T05:31:56Z",
"reason": "<string>",
"paidAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "ACCOUNT_NOT_VERIFIED",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "ACCOUNT_NOT_VERIFIED",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "ACCOUNT_NOT_VERIFIED",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "ACCOUNT_NOT_VERIFIED",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "ACCOUNT_NOT_VERIFIED",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}Saques
Solicitar um saque
Solicita um saque Pix do saldo disponível da conta. O valor é reservado imediatamente e o saque segue para a mesma fila de análise manual usada pelo painel — não é liberado automaticamente. Exige o escopo pix:withdraw.
Sem o campo pixKey, o saque usa a chave Pix de saque cadastrada em Configurações → Chave Pix de saque. O valor é validado contra os limites por saque, diário e noturno da conta.
POST
/
v1
/
public
/
pix
/
withdrawals
Solicitar um saque
curl --request POST \
--url https://api.zynpay.com.br/v1/public/pix/withdrawals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"amountCents": 50000,
"pixKey": "12345678909"
}
'import requests
url = "https://api.zynpay.com.br/v1/public/pix/withdrawals"
payload = {
"amountCents": 50000,
"pixKey": "12345678909"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amountCents: 50000, pixKey: '12345678909'})
};
fetch('https://api.zynpay.com.br/v1/public/pix/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.zynpay.com.br/v1/public/pix/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([
'amountCents' => 50000,
'pixKey' => '12345678909'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zynpay.com.br/v1/public/pix/withdrawals"
payload := strings.NewReader("{\n \"amountCents\": 50000,\n \"pixKey\": \"12345678909\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.zynpay.com.br/v1/public/pix/withdrawals")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amountCents\": 50000,\n \"pixKey\": \"12345678909\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zynpay.com.br/v1/public/pix/withdrawals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountCents\": 50000,\n \"pixKey\": \"12345678909\"\n}"
response = http.request(request)
puts response.read_body{
"withdrawal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "requested",
"amountCents": 123,
"feeCents": 123,
"netAmountCents": 123,
"createdAt": "2023-11-07T05:31:56Z",
"reason": "<string>",
"paidAt": "2023-11-07T05:31:56Z"
}
}{
"withdrawal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "requested",
"amountCents": 123,
"feeCents": 123,
"netAmountCents": 123,
"createdAt": "2023-11-07T05:31:56Z",
"reason": "<string>",
"paidAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "ACCOUNT_NOT_VERIFIED",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "ACCOUNT_NOT_VERIFIED",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "ACCOUNT_NOT_VERIFIED",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "ACCOUNT_NOT_VERIFIED",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "ACCOUNT_NOT_VERIFIED",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}Exige uma chave de API com o escopo
pix:withdraw. Esse escopo move dinheiro pra fora da conta — conceda ele só a integrações que realmente precisam automatizar saque, e guarde a chave com o mesmo cuidado de uma senha.O cabeçalho
Idempotency-Key é obrigatório. Reenviar a mesma chave com o mesmo corpo retorna o saque já criado, sem duplicar; reenviar com um corpo diferente retorna 409 IDEMPOTENCY_KEY_REUSED.pixKey no corpo, o saque usa a chave Pix de saque cadastrada em Configurações → Chave Pix de saque. O valor é validado contra os mesmos limites (por saque, diário e noturno) e a mesma regra de conta verificada que valem pro saque feito pelo painel — ver Como sacar.
curl https://api.zynpay.com.br/v1/public/pix/withdrawals \
-X POST \
-H "Authorization: Bearer zpk_live_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"amountCents": 50000}'
GET /v1/public/pix/withdrawals ou assine o webhook withdrawal.paid / withdrawal.rejected.Authorizations
Chave de API criada em Integrações → Chaves de API no painel.
Headers
Identificador único seu para essa cobrança. Reenviar a mesma chave com o mesmo corpo retorna a cobrança já criada; com um corpo diferente retorna 409.
Required string length:
1 - 255Body
application/json
Response
Mesma Idempotency-Key reenviada com o mesmo corpo — devolve o saque já criado, sem duplicar
Show child attributes
Show child attributes
