> For the complete documentation index, see [llms.txt](https://readme.streampayments.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://readme.streampayments.io/readme/documentation/products/recaudacion-por-qr.md).

# Recaudación por QR

## Webhook de Notificacion de estado final:

Una vez que se detecte que la transacción ha completado el proceso operativo (autorizada, expirada, denegada o fallida), el estado de la transacción será notificado al comercio a través de una URL webhook mediante una petición POST.

Por lo tanto, el comercio debe proporcionar un endpoint público HTTPS que acepte parámetros usando HTTP POST.

Los siguientes campos del cuerpo y cabaceras de la solicitud deben ser preparados y expuestos por el comercio en su webhook POST:

**Headers:**

<table><thead><tr><th width="279">Field</th><th width="128">Data Type</th><th width="143">Condition</th><th>Description</th></tr></thead><tbody><tr><td>x-signature</td><td>String</td><td>Mandatorio</td><td>Generación de firma de según la siguiente especificación: <a href="https://app.gitbook.com/o/83gIUIYTCm8MuWTqkip6/s/XK5LUrzl1Q87Hje8ayDc/~/changes/75/readme/documentation/gettings-started/configuracion#autenticacion-hmac-sha256-unificada">https://app.gitbook.com/o/83gIUIYTCm8MuWTqkip6/s/XK5LUrzl1Q87Hje8ayDc/~/changes/75/readme/documentation/gettings-started/configuracion#autenticacion-hmac-sha256-unificada</a></td></tr><tr><td>x-timestamp</td><td>String</td><td>Mandatorio</td><td>Fecha y hora actual en que se envía la notificación</td></tr></tbody></table>

**Body:**

<table><thead><tr><th width="279">Field</th><th width="128">Data Type</th><th width="143">Condition</th><th>Description</th></tr></thead><tbody><tr><td>product</td><td>String</td><td>Mandatorio</td><td>Constante "payin"</td></tr><tr><td>identifier</td><td>String</td><td>Mandatorio</td><td>Identificador de la operacion de Streampayments</td></tr><tr><td>externalIdentifier</td><td>String</td><td>Mandatorio</td><td>ID de la operación del comercio.</td></tr><tr><td>amount</td><td>String</td><td>Mandatorio</td><td>Monto de la transacción.</td></tr><tr><td>currency</td><td>String</td><td>Mandatorio</td><td><p>Moneda de la transacción </p><p>(ISO Alpha 3).</p></td></tr><tr><td>statusCode</td><td>String</td><td>Mandatorio</td><td>Código del estado de la transacción.</td></tr><tr><td>statusDescription</td><td>String</td><td>Mandatorio</td><td>Descripción del estado de la transacción.</td></tr><tr><td>errorDetails</td><td>Object</td><td>Opcional</td><td>Detalle del error.</td></tr><tr><td>errorDetails.code</td><td>String</td><td>Opcional</td><td>Código del error.</td></tr><tr><td>errorDetails.message</td><td>String</td><td>Opcional</td><td>Mensaje del error.</td></tr><tr><td>metaData</td><td>List&#x3C;Object></td><td>Opcional</td><td>Información metadata.</td></tr></tbody></table>

**Campos del Objeto metadata:**

<table><thead><tr><th width="155">Field</th><th width="128">Data Type</th><th width="143">Condition</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td>String</td><td>Mandatorio</td><td>Código del atributo</td></tr><tr><td>value</td><td>String</td><td>Mandatorio</td><td>Valor del atributo</td></tr></tbody></table>

### **Formato de Notificación**

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "product": "payin",
    "identifier": "SPAY9ID20812D250828051913",
    "externalIdentifier": "2012031",
    "amount": "100.00",
    "currency": "PEN",
    "statusCode": "1005",
    "statusDescription": "AUTHORIZED"
}
</code></pre>

***Nota***: *Los campos opcionales como* **errorDetails y metaData** *son condicionales al estado de la operación.*

### **Estados de Transacción PAYIN**

Durante el proceso, el estado de la transacción puede cambiar según cada evento, como se describe a continuación.

<figure><img src="/files/GUD3WmlLAcz2B3hyABU4" alt=""><figcaption></figcaption></figure>

Además del proceso transaccional, existen otros estados, como se describen a continuación:

<table><thead><tr><th width="166">Código del estado</th><th width="187">Nombre del estado</th><th align="center">Notificación vía webhook</th><th>Descripción</th></tr></thead><tbody><tr><td>1000</td><td>CREATED</td><td align="center">No</td><td>La transacción fue iniciada.</td></tr><tr><td>1001</td><td>FAILED</td><td align="center">Si</td><td>La transacción falló durante el procesamiento.</td></tr><tr><td>1002</td><td>PENDING</td><td align="center">No</td><td>La transacción está esperando el pago.</td></tr><tr><td>1003</td><td>DENIED</td><td align="center">Si</td><td>La transacción fue denegada.</td></tr><tr><td>1004</td><td>PRE_AUTHORIZED</td><td align="center">No</td><td>La transacción está en estado de autorización pendiente.</td></tr><tr><td>1005</td><td>AUTHORIZED</td><td align="center">Si</td><td>La transacción ha sido autorizada.</td></tr><tr><td>1006</td><td>EXPIRED</td><td align="center">Si</td><td>La transacción ha alcanzado el tiempo máximo para el pago y ha expirado.</td></tr><tr><td>1007</td><td>SETTLED</td><td align="center">No</td><td>La transacción ha sido liquidada al comercio.</td></tr></tbody></table>

***

### Catálogo de Errores PAYIN <a href="#catalogo-de-errores-payin" id="catalogo-de-errores-payin"></a>

**Http Status 400**

| ERROR CODE | ERROR MESSAGE                         |
| ---------- | ------------------------------------- |
| 400100     | MerchantId is required                |
| 400101     | Amount is required                    |
| 400102     | Currency is required                  |
| 400103     | Payment Method is required            |
| 400104     | Customer Name is required             |
| 400105     | Customer Last name is required        |
| 400106     | Document Type is required             |
| 400107     | Document Number is required           |
| 400108     | Email is required                     |
| 400109     | Cellphone Number is required          |
| 400110     | Merchant Operation Number is required |
| 400111     | Request Date is required              |
| 400112     | Expiry Time is required               |

| ERROR CODE | ERROR MESSAGE                            |
| ---------- | ---------------------------------------- |
| 400200     | Invalid MerchantId Format                |
| 400201     | Invalid Amount Format                    |
| 400202     | Invalid Currency Format                  |
| 400203     | Invalid Customer Name Format             |
| 400204     | Invalid Customer Last name Format        |
| 400205     | Invalid Document Type Format             |
| 400206     | Invalid Document Number Format           |
| 400207     | Invalid Email Format                     |
| 400208     | Invalid Cellphone Number Format          |
| 400209     | Invalid Merchant Operation Number Format |
| 400210     | Invalid Date Format                      |
| 400211     | Invalid Payment Description              |
| 400212     | Invalid Expiry Time                      |
| 400213     | Invalid Address                          |
| 400214     | Request Date is invalid                  |
| 400999     | Unknown field error validation           |

**Http Status 401**

| ERROR CODE | ERROR MESSAGE |
| ---------- | ------------- |
| 401100     | No Authorized |

**Http Status 403**

| ERROR CODE | ERROR MESSAGE          |
| ---------- | ---------------------- |
| 403100     | Merchant no authorized |

​**Http Status 422**

| ERROR CODE | ERROR MESSAGE                        |
| ---------- | ------------------------------------ |
| 422100     | Payment Method(s) no configured      |
| 422101     | Partner(s) no configured             |
| 422102     | Collector(s) no configured           |
| 422103     | Currency no configured               |
| 422104     | Document Type no configured          |
| 422105     | Merchant no configured               |
| 422106     | Country no configured                |
| 422107     | Payment Details no found             |
| 422108     | Transaction no found to be processed |
| 422109     | Status change is invalid             |

​**Http Status 500**

| ERROR CODE | ERROR MESSAGE  |
| ---------- | -------------- |
| 999999     | Internal Error |

***

### &#x20;**Métodos de Pago** <a href="#metodos-de-pago" id="metodos-de-pago"></a>

| `QR` | Código QR | SI |
| ---- | --------- | -- |

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://readme.streampayments.io/readme/documentation/products/recaudacion-por-qr.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.
