> For the complete documentation index, see [llms.txt](https://docs.apisunat.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apisunat.com/api-rest/personas/filename.md).

# fileName

Es el nombre que usaremos para el archivo XML. Este debe estar estructurado según parámetros de SUNAT. **`RRRRRRRRRRR-TT-SSSS-CCCCCCCC`** donde:

**R** = RUC (11 dígitos)

**T** = [Código de tipo de documento](/api-rest/personas/filename.md#codigo-de-tipo-de-documento) (2 dígitos)

**S** = [Serie](/api-rest/personas/filename.md#serie) (4 caracteres)

**C** = Número correlativo (8 dígitos)

#### **Ejemplo:**

```javascript
"fileName": "20123456789-01-F001-00000001"
```

#### Código de tipo de documento:

| Código | Tipo de Documento            |
| -----: | ---------------------------- |
|     01 | Factura                      |
|     03 | Boleta de Venta              |
|     04 | Liquidación de Compra        |
|     07 | Nota de Crédito              |
|     08 | Nota de Débito               |
|     09 | Guía de Remisión - Remitente |

#### Serie:

Para poder enviar documentos debes habilitar las series en el [**portal**](https://apisunat.com/) en la sección de **Configuración de Empresa**. Estas deben tener como primer carácter una letra definida por el tipo de documento:

* **Factura** debe empezar con "**F**".
* **Boleta de Venta** debe empezar con "**B**".
* **Liquidación de Compra** debe empezar con "**L**".
* **Nota de Crédito o Débito** debe empezar con "F" si modifica una Factura o "B" si modifica una Boleta de Venta.
* **Guía de Remisión - Remitente** debe empezar con **"T"**
* **Guía de Remisión - Transportista** debe empezar con **"V"**
* **Recibos de Servicios Públicos** debe empezar con **"S"**

{% hint style="info" %}
Las series de comprobantes de contingencia deben ser solo numéricas
{% endhint %}

![Captura de la sección "Configuración de Empresa" en apisunat.com](/files/-MKSK4-a0uw3J_Rm-bkU)


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.apisunat.com/api-rest/personas/filename.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
