# Finalize

## Finalizar Recibo

## Finaliza recibo com possibilidade de impressão ou envio de e-mail.

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

#### Path Parameters

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

#### Request Body

| Name     | Type    | Description                                                                                                                                                                                                                                  |
| -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| payments | Array   | <p>Pagamentos do Recibo</p><p></p><p>Deverá conter uma lista de objetos, sendo que cada objeto poderá conter os parâmetros de um pagamento conforme descritos no <a href="/pages/QmFSqJDMk8S4I0R0KzXp#pagamento-do-recibo">Apêndice</a>.</p> |
| print    | boolean | <p>Imprimir Recibo após a Finalização</p><p></p><p>O ficheiro PDF do Recibo é gerado ao finalizar.<br><br>Consulte os parâmetros disponíveis para impressão no <a href="/pages/QmFSqJDMk8S4I0R0KzXp#impressao-do-recibo">Apêndice</a>.</p>   |
| email    | boolean | <p>Enviar por E-mail após a Finalização</p><p></p><p>Consulte os parâmetros disponíveis para impressão no <a href="/pages/QmFSqJDMk8S4I0R0KzXp#envio-por-e-mail-do-recibo">Apêndice</a>.</p>                                                 |

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

```shell
curl -X POST https://api.cloudinvoice.net/receipts/1/finalize/
```

{% endtab %}

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

<pre class="language-json"><code class="lang-json">{
    "id": 1,
    "doc_key": "REC A01/1",
    "document_date": "2026-03-17",
    "document_time": "17:11:11",
    "document_number": 1,
    "party_reference": "",
    "module_origin": 1,
    "party_id": 2,
    "party": {
        "class": 1601,
        "code": 2,
        "name": "Cliente Demo",
        "commercial_name": "",
        "fiscal_number": "123456789",
        "street1": "",
        "street2": "",
        "zip_code": "8800-000",
        "zip_locale": "Tavira"
    },
    "line_details_count": 1,
    "total_gross_amount": 100.0,
    "is_percentage_discount": true,
    "discount_percentage": 0.0,
    "total_net_amount": 100.0,
    "total_amount": 100.0,
    "total_document_amount": 100.0,
    "total_received_amount": 100.0,
    "header_text": "",
    "footer_text": "",
    "number_of_prints": 0,
    "obs": "",
    "has_withholding": false,
    "document_nature_id": 341,
    "document_nature": {
        "code": "RG",
        "description": "Recibo"
    },
    "document_id": 14,
    "document": {
        "code": "REC",
        "document_name": "Recibo",
        "ask_payment_onclose": true
    },
    "document_serie_id": 1,
    "document_serie": {
        "code": "A01",
        "description": "Serie A01"
    },
<strong>    "document_status_id": 1202,
</strong><strong>    "document_status": {
</strong><strong>        "code": "F",
</strong><strong>        "description": "Finalizado"
</strong><strong>    },
</strong>    "salesman_id": 1,
    "salesman": {
        "code": 1,
        "salesman_name": "Vendedor 1"
    }
}
</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/recibos/finalize.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.
