> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cucu.bo/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /qr/{qrId} — Consultar estado

> Estado actual de un QR y el detalle de los pagos recibidos.

Devuelve el estado actual de un QR y el detalle de los pagos recibidos.

## Headers

| Header      | Tipo   | Req | Descripción |
| ----------- | ------ | --- | ----------- |
| `X-Api-Key` | string | Sí  | Tu API key. |

## Path Params

| Parámetro | Tipo   | Descripción                        |
| --------- | ------ | ---------------------------------- |
| `qrId`    | string | El `qrId` devuelto al crear el QR. |

## Response

| Campo                    | Tipo   | Descripción                                                      |
| ------------------------ | ------ | ---------------------------------------------------------------- |
| `qrId`                   | string | Identificador del QR.                                            |
| `status`                 | string | `PENDING`, `PAID`, `REJECTED`, `EXPIRED`, `CANCELLED` o `ERROR`. |
| `merchantCode`           | string | Código de tu comercio en CUCU.                                   |
| `orders`                 | array  | Pagos recibidos por este QR.                                     |
| `orders[].orderId`       | string | ID del pago.                                                     |
| `orders[].amount`        | string | Monto pagado.                                                    |
| `orders[].currency`      | string | `BOB`.                                                           |
| `orders[].paidAt`        | string | Fecha y hora del pago (ISO 8601).                                |
| `orders[].payerName`     | string | Nombre del pagador.                                              |
| `orders[].payerDocument` | string | CI/NIT del pagador.                                              |
| `orders[].payerBank`     | string | Banco del pagador.                                               |
| `orders[].payerAccount`  | string | Cuenta del pagador.                                              |
| `orders[].status`        | string | `PAID` o `REJECTED`.                                             |
| `metadata`               | object | Los datos que enviaste al crear el QR.                           |

<Note>
  Solo puedes consultar los QR de tu comercio. Un `qrId` de otro comercio responde `404`, igual que uno inexistente.
</Note>

<RequestExample>
  ```bash cURL theme={"system"}
  curl https://qrsimple.cucu.bo/api/v1/qr/<qrId> \
    -H "X-Api-Key: <tu_api_key>"
  ```

  ```javascript JavaScript theme={"system"}
  const response = await fetch(`https://qrsimple.cucu.bo/api/v1/qr/${qrId}`, {
    headers: { 'X-Api-Key': '<tu_api_key>' }
  });
  const estado = await response.json();
  ```

  ```python Python theme={"system"}
  import requests

  response = requests.get(
      f'https://qrsimple.cucu.bo/api/v1/qr/{qr_id}',
      headers={'X-Api-Key': '<tu_api_key>'}
  )
  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={"system"}
  {
    "qrId": "<qrId>",
    "status": "PAID",
    "merchantCode": "cucu-mi-comercio",
    "orders": [
      {
        "orderId": "<orderId>",
        "amount": "150.00",
        "currency": "BOB",
        "paidAt": "2026-09-15T14:12:33Z",
        "payerName": "Juan Pérez",
        "payerDocument": "12345678",
        "payerBank": "BNB",
        "payerAccount": "100000000001",
        "status": "PAID"
      }
    ],
    "metadata": { "channel": "web" }
  }
  ```

  ```json 404 Not Found theme={"system"}
  {
    "detail": "QR <qrId> no encontrado"
  }
  ```
</ResponseExample>
