Skip to main content

Request Withdrawal

Use this endpoint to send funds from your account to the customer or partner, in a single call.

As an alternative, the two-step flow checks that the PIX key belongs to the expected holder before settling: Create Withdrawal Intent and then Confirm Withdrawal Intent.

Available Environments​

https://api.gateway.com.br/core

Endpoint​

  • Method: POST
  • Endpoint: /withdrawal
  • Authentication: Bearer token

Request Body​

⚠️ Important: Amounts in Cents

Every monetary value (amount) must be sent in cents, as an integer.

Examples:

  • R$10.00 = 1000
  • R$99.99 = 9999
  • R$100.50 = 10050

DO NOT use: 99.99, 10.00, negative values USE: 9999, 1000 (always integers)

NameTypeRequiredDescriptionValidations
amountnumberYesWithdrawal amount (integer, in cents)Must be an integer in cents; minimum 10 (R$0.10) and maximum 10000000 (R$100,000.00)
methodstring (enum) - PIX (Default value: PIX)NoWithdrawal methodMust be a valid enum
webhookUrlstring (URL)NoHTTPS URL to receive notificationsMust be a valid URL, https required; no fragment (#); host and TLD required; query allowed
externalCodestringNoYour reference codeMust be between 8 and 255 characters
observationstringNoInternal note about the withdrawalMust be at most 255 characters
idempotencyKeystringYesUnique identifier to avoid duplicatesMust be between 8 and 255 characters
ℹ️ observation is for internal use only

The observation field is stored, but it is not returned by Get Withdrawal nor by List Withdrawals.

Withdrawal Destination​

NameTypeRequiredDescriptionValidations
pixKeystringYesDestination PIX keyMust be validated according to the pixKeyType provided:
  • CPF: 11 digits
  • CNPJ: 14 digits
  • EMAIL: valid format
  • PHONE: Brazilian format (+5511999999999)
  • EVP: valid UUID
pixKeyTypestring (enum) - CPF, CNPJ, EMAIL, PHONE, EVPYesKey typeMust be a valid enum

Request Example​

curl --request POST \
--url https://api.gateway.com.br/core/withdrawal \
--header 'Authorization: Bearer your-jwt-token' \
--header 'Content-Type: application/json' \
--data '{
"amount": 10000,
"pixKey": "12345678910",
"pixKeyType": "CPF",
"webhookUrl": "https://sua-api.com/webhooks/withdrawal",
"externalCode": "SAQUE-123",
"observation": "Repasse referente ao pedido 4521",
"idempotencyKey": "unique-key-12345"
}'

Success Response​

FieldTypeRequiredDescription
idstring (UUID)YesUnique identifier of the withdrawal
externalCodestringNoYour reference code
amountnumberYesWithdrawal amount (integer, in cents)
statusstring (enum) - PENDINGYes
  • PENDING: Withdrawal created, awaiting processing

Response Example​

{
"id": "553e8400-e29b-41d4-a716-436251480000",
"externalCode": "SAQUE-123",
"amount": 10000,
"status": "PENDING"
}

Possible Errors​

CodeDescriptionSolution
401Invalid credentialsCheck your credentials
403No permission/authorizationContact support
422Invalid or missing dataCheck the format of the data
422ValidationsContact support
429Too many requestsWait and try again
500Internal errorContact support