Saques

Criar saque

POST
/withdrawals

Cria uma solicitação de saque para uma chave PIX. Requer Token de Saque e saldo disponível.

Authorization

BearerAuth
AuthorizationBearer <token>

Token de Saque no formato Bearer Token. NUNCA exponha este token no client-side.

In: header

Request Body

application/json

amount*integer

Valor do saque em centavos

Range100 <= value
pix_key*string

Chave PIX para receber o saque (CPF, CNPJ, e-mail, telefone ou chave aleatória)

Match^[a-zA-Z0-9@._-]+$

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.exemplo.com/v1/withdrawals" \  -H "Content-Type: application/json" \  -d '{    "amount": 5000,    "pix_key": "usuario@exemplo.com"  }'
{
  "id": "wth_123456789",
  "status": "pending",
  "amount": 5000,
  "currency": "BRL",
  "pix_key": "usuario@exemplo.com",
  "created_at": "2024-01-15T10:00:00Z",
  "processed_at": null,
  "estimated_completion": "2024-01-15T14:00:00Z"
}
{
  "error": "Invalid request",
  "details": {
    "field": "amount",
    "message": "Amount must be at least 100 cents"
  }
}
{
  "error": "Unauthorized",
  "details": {
    "message": "Invalid or missing token"
  }
}
{
  "error": "Insufficient balance",
  "details": {
    "message": "Available balance is less than requested amount",
    "available_amount": 3000,
    "requested_amount": 5000
  }
}
{
  "error": "Validation error",
  "details": {
    "field": "pix_key",
    "message": "Invalid PIX key format"
  }
}