> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.erp.olist.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gerar Nota Fiscal

> Serviço para gerar nota fiscal a partir de um pedido.

## Endpoint

```
POST https://api.tiny.com.br/api2/pedido.gerar.nota.fiscal.php
```

## Parâmetros

| Parâmetro     | Tipo   | Ocorrência  | Descrição                                 |
| ------------- | ------ | ----------- | ----------------------------------------- |
| token         | string | obrigatório | Chave gerada para identificar sua empresa |
| formato       | string | obrigatório | Formato do retorno (json)                 |
| id            | int    | obrigatório | ID do pedido                              |
| serie         | string | opcional    | Série da nota fiscal (padrão: 1)          |
| enviar\_email | string | opcional    | S ou N (padrão: S)                        |

## Exemplo de chamada

```bash theme={null}
curl -X POST https://api.tiny.com.br/api2/pedido.gerar.nota.fiscal.php \
  -d "token=SEU_TOKEN&formato=json&id=789456&serie=1&enviar_email=S"
```

## Retorno

```json theme={null}
{
  "retorno": {
    "status_processamento": 3,
    "status": "OK",
    "registros": [
      {
        "registro": {
          "id": 654321,
          "numero": "12345",
          "serie": "1"
        }
      }
    ]
  }
}
```
