curl --request POST \
--url https://api-payment.safefypay.com.br/v1/cashouts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 50000,
"pixKeyType": "CPF",
"pixKey": "123.456.789-09"
}
'{
"data": {
"id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"externalId": "saque_001",
"amount": 50000,
"fee": 200,
"netAmount": 49800,
"currency": "BRL",
"status": "Pending",
"environment": "Sandbox",
"pix": {
"pixKeyType": "CPF",
"pixKey": "***456789**",
"endToEndId": null
},
"crypto": null,
"requestedAt": "2025-01-15T16:00:00Z",
"processedAt": null,
"completedAt": null,
"failureReason": null,
"createdAt": "2025-01-15T16:00:00Z"
},
"message": "Saque solicitado com sucesso.",
"error": null
}{
"data": null,
"message": null,
"error": {
"message": "Saldo insuficiente para realizar o saque.",
"code": "insufficient_balance"
}
}{
"data": null,
"message": null,
"error": {
"message": "Token invalido ou expirado.",
"code": "unauthorized"
}
}{
"data": null,
"message": null,
"error": {
"message": "Erro ao processar o saque. Tente novamente.",
"code": "internal_error"
}
}Cashouts
Create cashout
Request a PIX or crypto wallet withdrawal
POST
/
v1
/
cashouts
curl --request POST \
--url https://api-payment.safefypay.com.br/v1/cashouts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 50000,
"pixKeyType": "CPF",
"pixKey": "123.456.789-09"
}
'{
"data": {
"id": "b2c3d4e5-f6a7-8901-bcde-f23456789012",
"externalId": "saque_001",
"amount": 50000,
"fee": 200,
"netAmount": 49800,
"currency": "BRL",
"status": "Pending",
"environment": "Sandbox",
"pix": {
"pixKeyType": "CPF",
"pixKey": "***456789**",
"endToEndId": null
},
"crypto": null,
"requestedAt": "2025-01-15T16:00:00Z",
"processedAt": null,
"completedAt": null,
"failureReason": null,
"createdAt": "2025-01-15T16:00:00Z"
},
"message": "Saque solicitado com sucesso.",
"error": null
}{
"data": null,
"message": null,
"error": {
"message": "Saldo insuficiente para realizar o saque.",
"code": "insufficient_balance"
}
}{
"data": null,
"message": null,
"error": {
"message": "Token invalido ou expirado.",
"code": "unauthorized"
}
}{
"data": null,
"message": null,
"error": {
"message": "Erro ao processar o saque. Tente novamente.",
"code": "internal_error"
}
}Creates a cashout from the available balance to a PIX key or a previously registered and verified crypto wallet.
Provide exactly one destination:
pixKeyType+pixKeyfor a PIX cashout;cryptoPayoutAccountIdfor an XGate crypto cashout.
Crypto wallets must be registered and verified in the Safefy panel before requesting a cashout. The API does not accept an arbitrary wallet address in the request body.
This endpoint requires credential permission
cashouts.write.
If cashouts.allowAnyPixKey is disabled, arbitrary PIX destination keys are not allowed.Always use
withdrawNowAvailable from GET /v1/balance.
If requiresFullWithdrawalNow is true, the cashout amount must be exactly withdrawNowAvailable.Authorizations
Token JWT obtido via /v1/auth/token
Body
application/json
- Option 1
- Option 2
Valor do saque em centavos. Exemplo: R$ 500,00 = 50000.
Example:
50000
Tipo da chave PIX de destino.
Available options:
CPF, CNPJ, Email, Phone, Random Example:
"CPF"
Chave PIX de destino.
Example:
"12345678901"
ID de uma carteira cripto ativa e verificada. Exclusivo com pixKeyType/pixKey; a XGate é selecionada automaticamente.
Example:
"8d08f5d2-c6f6-4df9-b42f-6944aec3b177"
ID externo no seu sistema para referencia cruzada.
Example:
"saque_001"
URL para receber webhooks de atualizacao de status do saque.
Example:
"https://seusite.com.br/webhook/cashout"