# Withdraw to Pix key (/en/docs/conta-digital/endpoints/withdrawals/post_withdraw)

## POST /transactions/withdraw

`POST https://api.hub.payzu.com.br/api/v1/transactions/withdraw`

Scope: `WITHDRAW`. Sends a Pix from the account to a Pix key. `amount` is what reaches the destination; the fee is added on top. The total leaves the available balance when you make the request and returns if the withdrawal fails. A `201` response is not money delivered: confirmation comes through the `WITHDRAW_COMPLETED` webhook and failure through `WITHDRAW_FAILED`. Request limit: 5 per minute per credential and 10 per account, shared with Pix copy-and-paste payments and refunds.

### Header params

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | no | Unique value per operation, 1 to 255 visible ASCII characters, no spaces. Repeating the key with the same amount and destination returns the original operation; with a different amount or destination, `409`. Scoped to the account, no expiration. — minLength: 1; maxLength: 255 |

### Body params

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `amount` | integer | yes | Amount that reaches the destination. The fee is added on top. In cents. — minimum: 1 |
| `pixKey` | string | yes | Destination Pix key. — minLength: 1; maxLength: 77 |
| `pixKeyType` | string | no | Key type. Checked against the key; without it, the type is inferred from the format, and 11 digits can be a CPF or a mobile number. — `EVP`, `CNPJ`, `CPF`, `EMAIL`, `PHONE` |
| `comment` | string | no | Text sent to the recipient, when their bank displays it. — maxLength: 140 |
| `callbackUrl` | string | no | Public HTTPS URL that receives every webhook of this operation, in addition to the registered endpoints. Up to 2048 characters. Requires the account callback secret. — format: uri; maxLength: 2048 |

### Responses

**201** Withdrawal registered. With the same `Idempotency-Key` and data, the existing withdrawal, in its current state.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `id` | string | yes | Withdrawal identifier. The lookup accepts this `id` and the webhook `withdrawId`. |
| `status` | string | yes | `REQUESTED`: requested; the amount has already left the available balance. `CREATED`: registered at the bank. `APPROVED`: approved, on its way. `CONFIRMED`: the money arrived. `FAILED`: it did not go out, and the amount returned to the balance; it can come from `REQUESTED`, `CREATED` or `APPROVED`. — `REQUESTED`, `CREATED`, `APPROVED`, `CONFIRMED`, `FAILED` |
| `amount` | integer | yes | Amount that reaches the destination. In cents. |
| `serviceFee` | integer | yes | Fee, added on top. In cents. |
| `totalDebited` | integer | yes | `amount + serviceFee`: what leaves the account. In cents. |
| `pixKey` | string | yes | Destination key. For a withdrawal, the key sent, normalized; for a Pix copy-and-paste payment, masked (CPF, email and phone keys are masked; CNPJ and random keys are shown in full.) |
| `comment` | string | null | yes | Text sent to the recipient. |
| `e2e` | string | null | yes | End-to-end ID of the Pix. `null` until the bank registers it. |
| `providerRejectedReason` | string | null | yes | Message ready to display, set when the bank refused. |
| `callbackUrl` | string | null | yes | The `callbackUrl` sent on creation. `null` when none was sent. |
| `createdAt` | string | yes | Date and time in ISO 8601, UTC. — format: date-time |
| `sentAt` | string | null | yes | When the bank registered the withdrawal. — format: date-time |
| `approvedAt` | string | null | yes | When the bank approved the withdrawal. — format: date-time |
| `confirmedAt` | string | null | yes | When the money reached the destination. — format: date-time |

**400** Invalid request.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**401** Missing, invalid or expired credential.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**403** Not allowed: scope, IP or disabled operation.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**409** Conflict with the current state.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**412** A step is missing before this operation.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**422** Business rule refusal.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**429** Request limit exceeded.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**502** The bank did not respond or refused.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |

**503** Lookup service or rate limiter unavailable; nothing was done.

| Field | Type | Required | Details |
| --- | --- | --- | --- |
| `message` | string | yes | Description in Portuguese, ready to display. It may change at any time. |
| `code` | string | yes | Stable error code. Your system decides what to do based on it. |
| `details` | object | no | Structured error context, when available. |