Skip to main content

Create Withdrawal Intent

Use this endpoint to validate the destination of a withdrawal before settling it, confirming that the PIX key really belongs to the holder you expect.

The response carries the receiver's name and an intentId, which you then send to Confirm Withdrawal Intent. This is the first step of the two-step flow; to create a withdrawal in a single call, use Request Withdrawal.

Available Environments​

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

Endpoint​

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

Request Body​

⚠️ Important: Amounts in Cents

The 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)

ℹ️ The holderDocument is checked against the key

The platform looks up the holder of the PIX key and compares it with the holderDocument you sent. If they are not the same person, the intent is not created and the request is rejected.

That check is what sets this flow apart from direct creation: you find out that the key does not belong to the expected holder before the money leaves.

ℹ️ The intent expires in 5 minutes

The intentId stays valid for 5 minutes. After that, the confirmation replies that the intent was not found or has expired, and you have to create a new one.

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
holderDocumentstringYesDocument of the holder you expect to find on the keyMust be a valid CPF or CNPJ and match the holder of the key
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

Withdrawal Destination​

NameTypeRequiredDescriptionValidations
pixKeystringYesPIX key of the receiverMust be a valid key for the pixKeyType provided
pixKeyTypestring (enum) - CPF, CNPJ, EMAIL, PHONE, EVPYesPIX key typeMust be a valid enum

Request Example​

curl --request POST \
--url https://api.gateway.com.br/core/withdrawal/intent \
--header 'Authorization: Bearer your-jwt-token' \
--header 'Content-Type: application/json' \
--data '{
"amount": 10000,
"pixKey": "12345678910",
"pixKeyType": "CPF",
"holderDocument": "123.456.789-10",
"webhookUrl": "https://sua-api.com/webhooks/withdrawal",
"externalCode": "SAQUE-123",
"observation": "Repasse semanal"
}'

Success Response​

FieldTypeRequiredDescription
intentIdstring (UUID)YesIdentifier of the intent, used to confirm the withdrawal
typestring (enum) - PIX_KEYYesSource of the resolved destination
methodstring (enum) - PIXYesWithdrawal method
amountnumberYesWithdrawal amount (integer, in cents)
receiverNamestringNoName of the receiver, when the PSP provides it
FieldTypeRequiredDescription
pixKeystringYesPIX key of the destination
pixKeyTypestring (enum) - CPF, CNPJ, EMAIL, PHONE, EVPYesPIX key type of the destination

Response Example​

{
"intentId": "553e8400-e29b-41d4-a716-436251480000",
"type": "PIX_KEY",
"method": "PIX",
"amount": 10000,
"receiverName": "Fulano de Tal",
"pixKey": "12345678910",
"pixKeyType": "CPF"
}

Possible Errors​

CodeDescriptionSolution
401Invalid credentialsCheck your credentials
403No permission/authorizationContact support
422Invalid or missing dataCheck the format of the data
422ValidationsContact support
500Internal errorContact support
CodeDescriptionSolution
422The PIX key does not belong to the document providedCheck the holderDocument and the pixKey