Skip to main content
POST
Creates a cashout from the available balance to a PIX key or a previously registered and verified crypto wallet. Provide exactly one destination:
  • pixKeyType + pixKey for a PIX cashout;
  • payoutAccountId for a PIX cashout to a cashout account already registered and active in the dashboard;
  • cryptoPayoutAccountId for an XGate crypto cashout.
The merchant is identified by the API token. The active XGate crypto configuration is selected automatically; no acquirer identifier is required.
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.

Choose the settlement group

The balance can be split into settlement groups. The settlementGroupId field is optional:
  • Without settlementGroupId: nothing changes. The group is selected automatically and the amount follows withdrawNowAvailable.
  • With settlementGroupId: the cashout comes from that group, and the amount can go up to that group’s available.

Step by step

  1. Call GET /v1/balance.
  2. In balance.settlementGroups, pick the group and take its id.
  3. Right after that, create the cashout sending that id as settlementGroupId:
The group id is temporary.
  • Get the balance right before each cashout and use the id from that response.
  • Do not store the id for later: it can change or disappear when the group reaches zero or the account configuration changes.
  • Do not use the list position or the name “Group 1” as an identifier.

Errors

settlementGroupId cannot be combined with cryptoPayoutAccountId: the request is rejected with a validation error (400).

Authorizations

Authorization
string
header
required

Token JWT obtido via /v1/auth/token

Body

application/json
amount
integer<int64>
required

Valor do saque em centavos. Exemplo: R$ 500,00 = 50000.

Example:

50000

pixKeyType
enum<string>
required

Tipo da chave PIX de destino.

Available options:
CPF,
CNPJ,
Email,
Phone,
Random
Example:

"CPF"

pixKey
string
required

Chave PIX de destino.

Example:

"12345678901"

payoutAccountId
string<uuid> | null

ID de uma conta de saque PIX cadastrada e ativa no painel. Alternativa a pixKeyType/pixKey; exclusivo com eles e com cryptoPayoutAccountId.

Example:

"5b7c1e2a-3d4f-4a6b-8c9d-0e1f2a3b4c5d"

cryptoPayoutAccountId
string<uuid> | null

ID de uma carteira cripto ativa e verificada. Exclusivo com pixKeyType/pixKey; a XGate é selecionada automaticamente.

Example:

"8d08f5d2-c6f6-4df9-b42f-6944aec3b177"

externalId
string | null

ID externo no seu sistema para referencia cruzada.

Example:

"saque_001"

callbackUrl
string | null

URL para receber webhooks de atualizacao de status do saque.

Example:

"https://seusite.com.br/webhook/cashout"

settlementGroupId
string<uuid> | null

Opcional. Grupo de liquidacao de onde o saque sai: use um id de balance.settlementGroups consultado logo antes do saque. Sem o campo, o grupo e escolhido automaticamente. Nao pode ser usado com cryptoPayoutAccountId.

Example:

"0199a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b"

Response

Saque solicitado com sucesso

data
object | null
message
string | null
error
object | null