curl --request POST \
--url https://api.yuvexpay.com/v1/withdrawals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--data '
{
"amount": 500,
"method": "PIX",
"currency": "BRL",
"destination": {
"type": "pix",
"pixKey": "ana@example.com"
},
"description": "Weekly payout"
}
'import requests
url = "https://api.yuvexpay.com/v1/withdrawals"
payload = {
"amount": 500,
"method": "PIX",
"currency": "BRL",
"destination": {
"type": "pix",
"pixKey": "ana@example.com"
},
"description": "Weekly payout"
}
headers = {
"X-Idempotency-Key": "<x-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: {
'X-Idempotency-Key': '<x-idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 500,
method: 'PIX',
currency: 'BRL',
destination: {type: 'pix', pixKey: 'ana@example.com'},
description: 'Weekly payout'
})
};
fetch('https://api.yuvexpay.com/v1/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.yuvexpay.com/v1/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([
'amount' => 500,
'method' => 'PIX',
'currency' => 'BRL',
'destination' => [
'type' => 'pix',
'pixKey' => 'ana@example.com'
],
'description' => 'Weekly payout'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Idempotency-Key: <x-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.yuvexpay.com/v1/withdrawals"
payload := strings.NewReader("{\n \"amount\": 500,\n \"method\": \"PIX\",\n \"currency\": \"BRL\",\n \"destination\": {\n \"type\": \"pix\",\n \"pixKey\": \"ana@example.com\"\n },\n \"description\": \"Weekly payout\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency-Key", "<x-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.yuvexpay.com/v1/withdrawals")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 500,\n \"method\": \"PIX\",\n \"currency\": \"BRL\",\n \"destination\": {\n \"type\": \"pix\",\n \"pixKey\": \"ana@example.com\"\n },\n \"description\": \"Weekly payout\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yuvexpay.com/v1/withdrawals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 500,\n \"method\": \"PIX\",\n \"currency\": \"BRL\",\n \"destination\": {\n \"type\": \"pix\",\n \"pixKey\": \"ana@example.com\"\n },\n \"description\": \"Weekly payout\"\n}"
response = http.request(request)
puts response.read_body{
"withdrawal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"txId": "<string>",
"grossAmount": 123,
"feeAmount": 123,
"netAmount": 123,
"pixKey": "<string>",
"pixKeyType": "<string>",
"isSandbox": true,
"createdAt": "2023-11-07T05:31:56Z",
"paymentMethod": "PIX",
"currency": "BRL",
"processedAt": "2023-11-07T05:31:56Z",
"errorMessage": "<string>"
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": {
"amount": "Must be greater than 0.01"
}
}
}{
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid or revoked API key"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "IDEMPOTENCY_PAYLOAD_MISMATCH",
"message": "Idempotency key already used with a different request body"
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests"
}
}Create a withdrawal
Create a PIX withdrawal to transfer BRL funds from your YuvexPay balance. Requires an idempotency key.
The PIX key type (CPF, CNPJ, e-mail, phone, or random key) is detected automatically from destination.pixKey — you do not need to declare it. Invalid keys are rejected with INVALID_PIX_KEY.
The creditor document on the network is always derived server-side from your verified company tax id (CNPJ for business accounts, owner CPF for individual accounts).
Withdrawals may be blocked outside business hours or if your account has restrictions.
curl --request POST \
--url https://api.yuvexpay.com/v1/withdrawals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--data '
{
"amount": 500,
"method": "PIX",
"currency": "BRL",
"destination": {
"type": "pix",
"pixKey": "ana@example.com"
},
"description": "Weekly payout"
}
'import requests
url = "https://api.yuvexpay.com/v1/withdrawals"
payload = {
"amount": 500,
"method": "PIX",
"currency": "BRL",
"destination": {
"type": "pix",
"pixKey": "ana@example.com"
},
"description": "Weekly payout"
}
headers = {
"X-Idempotency-Key": "<x-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: {
'X-Idempotency-Key': '<x-idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 500,
method: 'PIX',
currency: 'BRL',
destination: {type: 'pix', pixKey: 'ana@example.com'},
description: 'Weekly payout'
})
};
fetch('https://api.yuvexpay.com/v1/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.yuvexpay.com/v1/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([
'amount' => 500,
'method' => 'PIX',
'currency' => 'BRL',
'destination' => [
'type' => 'pix',
'pixKey' => 'ana@example.com'
],
'description' => 'Weekly payout'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Idempotency-Key: <x-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.yuvexpay.com/v1/withdrawals"
payload := strings.NewReader("{\n \"amount\": 500,\n \"method\": \"PIX\",\n \"currency\": \"BRL\",\n \"destination\": {\n \"type\": \"pix\",\n \"pixKey\": \"ana@example.com\"\n },\n \"description\": \"Weekly payout\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency-Key", "<x-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.yuvexpay.com/v1/withdrawals")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 500,\n \"method\": \"PIX\",\n \"currency\": \"BRL\",\n \"destination\": {\n \"type\": \"pix\",\n \"pixKey\": \"ana@example.com\"\n },\n \"description\": \"Weekly payout\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yuvexpay.com/v1/withdrawals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 500,\n \"method\": \"PIX\",\n \"currency\": \"BRL\",\n \"destination\": {\n \"type\": \"pix\",\n \"pixKey\": \"ana@example.com\"\n },\n \"description\": \"Weekly payout\"\n}"
response = http.request(request)
puts response.read_body{
"withdrawal": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"txId": "<string>",
"grossAmount": 123,
"feeAmount": 123,
"netAmount": 123,
"pixKey": "<string>",
"pixKeyType": "<string>",
"isSandbox": true,
"createdAt": "2023-11-07T05:31:56Z",
"paymentMethod": "PIX",
"currency": "BRL",
"processedAt": "2023-11-07T05:31:56Z",
"errorMessage": "<string>"
}
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": {
"amount": "Must be greater than 0.01"
}
}
}{
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid or revoked API key"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "IDEMPOTENCY_PAYLOAD_MISMATCH",
"message": "Idempotency key already used with a different request body"
}
}{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Too many requests"
}
}Authorizations
YuvexPay API key. Include as Authorization: Bearer ypk_<env>_<kid>_<secret> where <env> is test (sandbox) or live (production). Create and manage keys in the dashboard under Settings > API Keys.
Headers
A unique string to ensure the request is processed only once. Must be unique per request. Valid for 24 hours.
100Body
Withdrawal amount (minimum R$10.00).
10 <= x <= 1000000Must be a multiple of 0.01Where to send the funds.
Show child attributes
Show child attributes
Public withdrawals currently support PIX only.
PIX BRL Internal description for this withdrawal.
500Response
Withdrawal created.
Show child attributes
Show child attributes

