> 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.md).

# /personas

## sendBill

<mark style="color:green;">`POST`</mark> `URL /personas/v1/sendBill`

Envío de documentos

#### Request Body

| Name                                           | Type   | Description                                                                                                                                                                                                                                                                                                                                                     |
| ---------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| personaId<mark style="color:red;">\*</mark>    | string | Identificador de tu empresa                                                                                                                                                                                                                                                                                                                                     |
| personaToken<mark style="color:red;">\*</mark> | string | Token de acceso de tu empresa                                                                                                                                                                                                                                                                                                                                   |
| fileName<mark style="color:red;">\*</mark>     | string | <p>Nombre que usaremos para el archivo XML según parámetros de SUNAT. <strong><code>RRRRRRRRRRR-TT-SSSS-CCCCCCCC</code></strong><br><br>Donde:<br><strong>R</strong> = RUC (11 dígitos)<br><strong>T</strong> = Código de tipo de documento (2 dígitos)<br><strong>S</strong> = Serie (4 caracteres)<br><strong>C</strong> = Número correlativo (8 dígitos)</p> |
| documentBody<mark style="color:red;">\*</mark> | object | Objeto con todos los datos del documento                                                                                                                                                                                                                                                                                                                        |
| customerEmail                                  | string | Email del adquiriente. Si lo pones le enviaremos el documento luego de ser emitido.                                                                                                                                                                                                                                                                             |

{% tabs %}
{% tab title="200: OK El valor status esperado es PENDIENTE" %}

```javascript
{
    "status": "PENDIENTE",
    "documentId": "5d4g1e88b30104056706dffe"
}
```

{% endtab %}

{% tab title="400: Bad Request Si el status es diferente a PENDIENTE entonces la petición fracasó. Los detalles del error estarán en el objeto "error": {}" %}

```javascript
{
    "status": "ERROR",
    "error": {} // objeto con datos del error
}
```

{% endtab %}
{% endtabs %}

## voidBill

<mark style="color:green;">`POST`</mark> `URL /personas/v1/voidBill`

Anulación de documentos

#### Request Body

| Name                                           | Type   | Description                                    |
| ---------------------------------------------- | ------ | ---------------------------------------------- |
| personaId<mark style="color:red;">\*</mark>    | string | Identificador de tu empresa                    |
| personaToken<mark style="color:red;">\*</mark> | string | Token de acceso de tu empresa                  |
| documentId<mark style="color:red;">\*</mark>   | string | Identificador del documento que se va a anular |
| reason<mark style="color:red;">\*</mark>       | string | Motivo de la anulación (3 - 100 caracteres)    |

{% tabs %}
{% tab title="200: OK El valor status esperado es PENDIENTE" %}

```javascript
{
    "status": "PENDIENTE",
    "documentId": "5d4g1e88b30104056706dffe"
}
```

{% endtab %}

{% tab title="400: Bad Request Si el status es diferente a PENDIENTE entonces la petición fracasó. Los detalles del error estarán en el objeto "error": {}" %}

```javascript
{
    "status": "ERROR",
    "error": {} // objeto con datos del error
}
```

{% endtab %}
{% endtabs %}

## lastDocument

<mark style="color:green;">`POST`</mark> `URL /personas/lastDocument`

Obtener el número correlativo

#### Request Body

| Name                                           | Type   | Description                             |
| ---------------------------------------------- | ------ | --------------------------------------- |
| personaId<mark style="color:red;">\*</mark>    | string | Identificador de tu empresa             |
| personaToken<mark style="color:red;">\*</mark> | string | Token de acceso de tu empresa           |
| type<mark style="color:red;">\*</mark>         | string | Código de tipo de documento (2 dígitos) |
| serie<mark style="color:red;">\*</mark>        | string | Serie (4 caracteres)                    |

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

```javascript
{
    "personaId": "5f6cd73425f5c52d375dd55c",
    "production": true,
    "type": "01",
    "serie": "F001",
    "lastNumber":"00000001",
    "suggestedNumber":"00000002"
}
```

{% endtab %}
{% endtabs %}
