Skip to main content

Confirm Withdrawal Intent

Use this endpoint to carry out a withdrawal from an intent created in Create Withdrawal Intent.

This is the second step of the two-step flow. The amount, destination and remaining data were already sent and validated in the intent, so here you send only the idempotency key.

Available Environments​

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

Endpoint​

  • Method: POST
  • Endpoint: /withdrawal/intent/{id}/confirm
  • Authentication: Bearer token

Path Params​

NameTypeRequiredDescriptionValidations
idstring (UUID)YesintentId returned by Create Withdrawal IntentMust be a valid UUID

Request Body​

ℹ️ Each intent is good for one withdrawal only

Once confirmed, the intent is consumed: a second call with the same intentId is refused. And once the 5 minutes of validity have passed, the intent is no longer accepted either.

NameTypeRequiredDescriptionValidations
idempotencyKeystringYesUnique identifier that prevents duplicatesMust be between 8 and 255 characters

Request Example​

curl --request POST \
--url https://api.gateway.com.br/core/withdrawal/intent/553e8400-e29b-41d4-a716-436251480000/confirm \
--header 'Authorization: Bearer your-jwt-token' \
--header 'Content-Type: application/json' \
--data '{
"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-436251480001",
"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
422Intent not found or expiredCreate a new intent and send it again
422Intent already usedCreate a new intent for each withdrawal
422ValidationsContact support
429Too many requestsWait and try again
500Internal errorContact support