> For the complete documentation index, see [llms.txt](https://wikiedoc.guru-soft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wikiedoc.guru-soft.com/pe/proceso-de-facturacion/descripcion-del-flujo.md).

# Descripción del Flujo

### 1. Generación Documento ERP&#x20;

#### El ERP genera:&#x20;

* Factura &#x20;
* Boleta &#x20;
* Nota Crédito &#x20;
* Nota Débito &#x20;
* Guía &#x20;

### 2. Envío API&#x20;

El ERP consume:&#x20;

* REST API &#x20;
* SOAP Service &#x20;

Enviando:&#x20;

* JSON &#x20;
* XML &#x20;
* Datos tributarios &#x20;

### 3. Validaciones Iniciales&#x20;

La plataforma valida:&#x20;

* Campos obligatorios &#x20;
* Catálogos SUNAT &#x20;
* Totales &#x20;
* Impuestos &#x20;
* Estructura &#x20;

### 4. Generación XML UBL&#x20;

Se construye el XML oficial bajo estándar UBL 2.1.&#x20;

### 5. Firma Digital&#x20;

El XML es firmado utilizando:&#x20;

* Certificado digital &#x20;
* SHA256 &#x20;
* Firma XMLDSig &#x20;

### 6. Envío OSE&#x20;

El documento es enviado al OSE para:&#x20;

* Validación tributaria &#x20;
* Validación estructural &#x20;
* Validación normativa &#x20;

### 7. Validación SUNAT&#x20;

SUNAT procesa:&#x20;

* Reglas tributarias &#x20;
* Consistencia &#x20;
* Autorización &#x20;

### 8. Recepción CDR&#x20;

El sistema recibe:&#x20;

* Aceptado &#x20;
* Rechazado &#x20;
* Observado &#x20;

### 9. Actualización ERP&#x20;

El resultado es retornado al ERP junto con:&#x20;

* XML &#x20;
* CDR &#x20;
* PDF &#x20;
* Hash &#x20;
* Estado &#x20;


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://wikiedoc.guru-soft.com/pe/proceso-de-facturacion/descripcion-del-flujo.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
