# Annul

## Anular Documento

{% hint style="danger" %}
A anulação de um documento não poderá ser revertida em circunstância alguma.
{% endhint %}

## Anula documento finalizado.

<mark style="color:green;">`POST`</mark> `https://api.cloudinvoice.net/documents/:id/annul/`

#### Path Parameters

| Name                                 | Type    | Description     |
| ------------------------------------ | ------- | --------------- |
| id<mark style="color:red;">\*</mark> | integer | ID do Documento |

#### Request Body

| Name                                             | Type    | Description                                                                                                                                                                                  |
| ------------------------------------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| status\_reason<mark style="color:red;">\*</mark> | string  | Motivo da Anulação                                                                                                                                                                           |
| print                                            | boolean | <p>Imprimir Documento após a Anulação </p><p></p><p>Consulte os parâmetros disponíveis para impressão no <a href="/pages/BdlvhGZBoKlBoSmsSOiC#impressao-do-documento">Apêndice</a>.</p>      |
| email                                            | boolean | <p>Enviar por E-mail após a Anulação</p><p></p><p>Consulte os parâmetros disponíveis para impressão no <a href="/pages/BdlvhGZBoKlBoSmsSOiC#envio-por-e-mail-do-documento">Apêndice</a>.</p> |

{% tabs %}
{% tab title="Exemplo de Pedido" %}

```shell
curl -X POST https://api.cloudinvoice.net/documents/1/annul/
```

{% endtab %}

{% tab title="Exemplo de Resposta" %}

<pre class="language-json"><code class="lang-json">{
    "id": 1,
    "doc_key": "FSI A01/1",
    "document_date": "2023-01-11",
    "document_time": "13:32:36",
    "document_number": 1,
    "document_reference": "",
    "our_reference": "",
    "module_origin": 1,
    "party_id": 1,
    "party": {
        "class": 1601,
        "code": 1,
        "name": "Consumidor Final",
        "commercial_name": "",
        "fiscal_number": "999999990",
        "street1": "",
        "street2": "",
        "zip_code": "",
        "zip_locale": ""
    },
    "line_details_count": 2,
    "lines_total_quantity": 3.0,
    "is_valued": true,
    "is_tax_included": true,
    "total_gross_amount": 5.23,
    "global_discount1": 0.0,
    "total_global_discount": 0.0,
    "total_line_discount": 0.0,
    "total_net_amount": 4.2520325203,
    "total_taxes_amount": 0.9779674797,
    "total_amount": 5.23,
    "total_document_amount": 5.23,
    "total_round_amount": 0.0,
    "total_due_amount": 0.0,
    "due_date": "2023-01-11",
    "is_converted": false,
    "header_text": "",
    "footer_text": "",
    "number_of_prints": 0,
    "is_transport_document": false,
    "obs": "",
    "document_nature_id": 302,
    "document_nature": {
        "code": "FS", 
        "description": "Factura Simplificada"
    },
    "document_id": 2,
    "document": {
        "code": "FSI", 
        "document_name": "Factura Simplificada", 
        "ask_payment_onclose": true
    },
    "document_serie_id": 1,
    "document_serie": {
        "code": "A01", 
        "description": "Série A01"
    },
<strong>    "document_status_id": 1203,
</strong><strong>    "document_status": {
</strong><strong>        "code": "A",
</strong><strong>        "description": "Anulado"
</strong><strong>    },
</strong>    "warehouse_id": 1,
    "warehouse": {
        "code": 1, 
        "description": "Armazém 1"
    },
    "salesman_id": 1,
    "salesman": {
        "code": 1, 
        "salesman_name": "Empregado 1"
    },
    "payment_term_id": 1,
    "payment_term": {
        "code": 1,
        "description": "Pronto Pagamento"
    },
    "payment_method_id": 1,
    "payment_method": {
        "code": 1,
        "description": "Dinheiro"
    },
    "origin_document_header_id": null,
    "origin_document_header": null
}
</code></pre>

{% endtab %}
{% endtabs %}

Para ver exemplos de pedidos nas várias linguagens, consulte a página[ Exemplos de Pedidos.](/introducao/exemplos-de-pedidos.md)


---

# Agent Instructions: 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://apidocs.cloudinvoice.net/documentacao-api/documentos/acoes/annul.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.
