> For the complete documentation index, see [llms.txt](https://expedy.gitbook.io/openapi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://expedy.gitbook.io/openapi/order/invoice.md).

# Invoice

## Post Invoice

<mark style="color:green;">`POST`</mark> `/v1/order/:id/invoice`

Endpoint para cadastro de NF-e.

#### Query Parameters

| Name                                 | Type   | Description   |
| ------------------------------------ | ------ | ------------- |
| id<mark style="color:red;">\*</mark> | string | Id do pedido. |

#### Headers

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Access token para autenticação. |
| Content-Type<mark style="color:red;">\*</mark>  | string | application/json                |

#### Request Body

| Name                                            | Type   | Description                                                                                           |
| ----------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------- |
| issue\_date<mark style="color:red;">\*</mark>   | string | Data da NF-e.                                                                                         |
| number<mark style="color:red;">\*</mark>        | string | Número da NF-e.                                                                                       |
| serie<mark style="color:red;">\*</mark>         | string | Série da NF-e.                                                                                        |
| value<mark style="color:red;">\*</mark>         | string | Valor da NF-e.                                                                                        |
| key<mark style="color:red;">\*</mark>           | string | Chave da NF-e.                                                                                        |
| link<mark style="color:red;">\*</mark>          | string | Link da NF-e                                                                                          |
| xml\_danfe<mark style="color:red;">\*</mark>    | string | Xml da NF-e.                                                                                          |
| ProductCfop<mark style="color:red;">\*</mark>   | array  | Array de objetos com os dados do produto. Contendo os campos "product\_id", "variation\_id" e "cfop". |
| product\_id<mark style="color:red;">\*</mark>   | string | Id do produto.                                                                                        |
| variation\_id<mark style="color:red;">\*</mark> | string | Id da variação do produto.                                                                            |
| cfop<mark style="color:red;">\*</mark>          | string | CFOP do produto.                                                                                      |

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

```
```

{% endtab %}
{% endtabs %}

É necessário mandar o id do pedido na url, ficando como: **`/v1/order/7/invoice`** por exemplo.

Segue o exemplo de body abaixo.

```json
## Exemplo de Body ##
{
    "issue_date": "2016-08-15",
    "number": 213123213213,
    "serie": 123,
    "value": 50.85,
    "key": "12345678901234567890123456789012345678901234",
    "link": "http://www.link.com.br/12345678901234567890123456789012345678901234",
    "xml_danfe": "### XML DANFE ###",
    "ProductCfop": [
        {
            "product_id": "123",
            "variation_id": "123",
            "cfop": "1234"
        }
    ]
}
```


---

# 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://expedy.gitbook.io/openapi/order/invoice.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.
