# Gerar QR Code PIX Dinâmico

Cria um QR Code PIX do tipo dinâmico, vinculado a uma cobrança única, com identificação do pagador e metadados descritivos.

Este endpoint gera um **QR Code PIX dinâmico**, ou seja, um código único associado a uma transação específica.

Diferente do QR Code estático, o **QR Code dinâmico** contém um identificador exclusivo (`txId`) e pode incluir informações adicionais, como dados do pagador e metadados descritivos (ex.: produto, serviço, fatura, etc.).

O corpo da requisição deve conter:

* `key`: valor ou identificador da chave PIX associada à conta;
* `amount`: valor a ser cobrado (em reais, com até duas casas decimais);
* `payer`: informações do pagador, contendo `document` e `name`;
* `description`: lista de objetos com nome e valor, permitindo detalhar o pagamento.

O retorno inclui:

* **`qrCode.image`** → imagem do QR Code em base64;
* **`qrCode.text`** → conteúdo EMV completo do QR Code;
* **`invoice.url`** → link do comprovante ou fatura associada à cobrança.

## Endpoint para Criar Qr Code Dinâmico

<mark style="color:green;">`POST`</mark> `/accounts/{accountId}/pix/qrcode/dynamic`

Este endpoint é protegido e requer o uso do cabeçalho `Authorization: Bearer <token>` e `x-tenant-id`.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |
| x-tenant-id   | `Tenant ID`        |

**Body**

| Name             | Type                                   | Description                             |
| ---------------- | -------------------------------------- | --------------------------------------- |
| `key`            | string                                 | Chave para qual o QR Code será atrelado |
| `amount`         | number                                 | Valor                                   |
| `payer`          | object{document: string, name: string} | Descrição (opcional)                    |
| `payer.document` | string                                 | CPF/CNPJ                                |
| `payer.name`     | string                                 | Nome                                    |
| `description`    | Array<{name: string,value: string}>    | Descrição                               |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "qrCode": {
    "image": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAABWKLW/AAAABHNCSVQICAgIfAhkiAAA...",
    "text": "00020101021226900014BR.GOV.BCB.PIX2568pix.stricglobal.com.br/publico/cob/8a1f22e2bbef4f678b3f2a9c3efb94255204000053039865802BR5920Juliana Santos Almeida6010Rio Grande62070503***6304901A"
  },
  "invoice": {
    "url": "https://global.stric.com.br/invoices/7d39c9af-1a3d-4a4e-8b0f-24e9d1b3d2a8/invoice.pdf"
  }
}

```

{% endtab %}

{% tab title="404" %}

```json
{
    "code": "NOT_FOUND",
    "error": "Informações da chave pix não encontrada",
    "message": "Informações da chave pix não encontrada"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stric.com.br/documentacao/geracao-de-qr-code/gerar-qr-code-pix-dinamico.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
