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
- Production
https://api.gateway.com.br/core
Endpoint
- Method:
POST - Endpoint:
/withdrawal/intent/{id}/confirm - Authentication: Bearer token
Path Params
| Name | Type | Required | Description | Validations |
|---|---|---|---|---|
id | string (UUID) | Yes | intentId returned by Create Withdrawal Intent | Must 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.
| Name | Type | Required | Description | Validations |
|---|---|---|---|---|
idempotencyKey | string | Yes | Unique identifier that prevents duplicates | Must be between 8 and 255 characters |
Request Example
- cURL
- JavaScript
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"
}'
const response = await fetch('https://api.gateway.com.br/core/withdrawal/intent/553e8400-e29b-41d4-a716-436251480000/confirm', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-jwt-token',
'Content-Type': 'application/json'
},
body: JSON.stringify({
idempotencyKey: 'unique-key-12345',
})
});
const data = await response.json();
Success Response
| Field | Type | Required | Description |
|---|---|---|---|
id | string (UUID) | Yes | Unique identifier of the withdrawal |
externalCode | string | No | Your reference code |
amount | number | Yes | Withdrawal amount (integer, in cents) |
status | string (enum) - PENDING | Yes |
|
Response Example
{
"id": "553e8400-e29b-41d4-a716-436251480001",
"externalCode": "SAQUE-123",
"amount": 10000,
"status": "PENDING"
}
Possible Errors
| Code | Description | Solution |
|---|---|---|
| 401 | Invalid credentials | Check your credentials |
| 403 | No permission/authorization | Contact support |
| 422 | Invalid or missing data | Check the format of the data |
| 422 | Intent not found or expired | Create a new intent and send it again |
| 422 | Intent already used | Create a new intent for each withdrawal |
| 422 | Validations | Contact support |
| 429 | Too many requests | Wait and try again |
| 500 | Internal error | Contact support |