# Pay Pix code (/en/docs/conta-digital/endpoints/pix/post_pix_qr_payment)

## POST /transactions/pix/qr-payments

`POST https://api.hub.payzu.com.br/api/v1/transactions/pix/qr-payments`

Scope: `WITHDRAW`. Pays a Pix copy-and-paste code, static or dynamic, from the account available balance. It works like a withdrawal: same response, limits, daily cap and request limit, with the Pix copy-and-paste payment fee (`externalPayment` in limits). `Idempotency-Key` also compares the paid code. Track it through the `WITHDRAW_*` webhooks and the withdrawal lookup, with `operation: EXTERNAL_PAYMENT`.

### 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 |
| --- | --- | --- | --- |
| `brCode` | string | yes | Full Pix copy-and-paste code, as read. — minLength: 8; maxLength: 1024 |
| `amount` | integer | no | Amount to pay, when the code has no amount. If it has one, it must match the code. In cents. |
| `comment` | string | no | Text sent to the recipient. Without it, the recipient name in the code is used. — 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** Payment registered.

| 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. |

**404** Not found, or from another account.

| 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. |