> For the complete documentation index, see [llms.txt](https://docs.apisunat.pe/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apisunat.pe/integracion/facturacion-electronica/boleta/boleta-simple.md).

# Boleta simple

### Endpoint

<mark style="color:green;">`POST`</mark> `https://sandbox.apisunat.pe/api/v3/documents`

### Header

Es obligatorio incluir el encabezado `Authorization` en cada solicitud.\
El **token es único por empresa** y puedes obtenerlo ingresando a [https://app.apisunat.pe](https://app.apisunat.pe?utm_source=chatgpt.com), en el módulo de **Organizaciones**.

```powershell
header 'Authorization: Bearer {TOKEN}'
```

### Request Body

{% code fullWidth="false" %}

```json
{
    "documento": "boleta",
    "serie": "B001",
    "numero": 123,
    "fecha_de_emision": "2025-01-03",
    "hora_de_emision": "19:40:00", //Opcional
    "moneda": "PEN",
    "tipo_operacion": "0101",
    "cliente_tipo_de_documento": "1",
    "cliente_numero_de_documento": "75413811",
    "cliente_denominacion": "NOMBRE DEL CLIENTE",
    "cliente_direccion": "AV. SAN MARTIN - LIMA",
    "items": [
        {
            "unidad_de_medida": "NIU",
            "descripcion": "Nombre del producto",
            "cantidad": "1",
            "valor_unitario": "234.125457", //Se recomienda usar 6 decimales
            "porcentaje_igv": "18",
            "codigo_tipo_afectacion_igv": "10",
            "nombre_tributo": "IGV"
        }
    ],
    "total": "276.27"
}
```

{% endcode %}

### Response

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

<pre class="language-json" data-title="El comprobante está firmado y aceptado por SUNAT" data-full-width="false"><code class="lang-json">{
    "success": true,
    "message": "Boleta B001-123 emitida correctamente",
    "payload": {
<strong>        "estado": "ACEPTADO",
</strong>        "hash": "4HY34uR7a+Vc1Ax3/zrUk1Ng+tjTLwlqa9mRFysy15E=",
        "xml": "http://app.apisunat.pe/20123456789-03-B001-123.xml",
        "cdr": "http://app.apisunat.pe/R-20123456789-03-B001-123.xml",
        "pdf": {
            "ticket": "http://app.apisunat.pe/pdf/ticket/20123456789-03-B001-123"
        }
    }
}
</code></pre>

<pre class="language-json" data-title="El comprobante está firmado y pendiente de la aceptación de SUNAT"><code class="lang-json">{
    "success": true,
    "message": "Boleta B001-123 emitida correctamente",
    "payload": {
<strong>        "estado": "PENDIENTE",
</strong>        "hash": "4HY34uR7a+Vc1Ax3/zrUk1Ng+tjTLwlqa9mRFysy15E=",
        "xml": "http://app.apisunat.pe/20123456789-03-B001-123.xml",
        "cdr": null,
        "pdf": {
            "ticket": "http://app.apisunat.pe/pdf/ticket/20123456789-03-B001-123"
        }
    }
}
</code></pre>

<pre class="language-json" data-title="El comprobante fue rechazado por SUNAT debido a datos incorrectos" data-full-width="false"><code class="lang-json">{
    "success": true,
    "message": "Boleta B001-123 emitida correctamente",
    "payload": {
<strong>        "estado": "RECHAZADO",
</strong>        "hash": "4HY34uR7a+Vc1Ax3/zrUk1Ng+tjTLwlqa9mRFysy15E=",
        "xml": "http://app.apisunat.pe/20123456789-03-B001-123.xml",
        "cdr": "http://app.apisunat.pe/R-20123456789-03-B001-123.xml",
        "pdf": {
            "ticket": "http://app.apisunat.pe/pdf/ticket/20123456789-03-B001-123"
        }
    }
}
</code></pre>

{% endtab %}

{% tab title="422 Error en datos" %}

```json
{
    "success": false,
    "message": "El campo documento es requerido"
}
```

{% endtab %}

{% tab title="400 Error al procesar" %}
{% code title="Documento duplicado" overflow="wrap" %}

```json
{
    "success": false,
    "message": "ERROR: boleta B002-1 fue emitido anteriormente."
}
```

{% endcode %}
{% endtab %}

{% tab title="401 Error de permisos" %}

```json
{
    "success": false,
    "message": "Acceso no autorizado."
}
```

{% endtab %}
{% endtabs %}


---

# 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://docs.apisunat.pe/integracion/facturacion-electronica/boleta/boleta-simple.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.
