# Adicionar da Nota Fiscal

## Endpoint

{% openapi src="<https://3852815132-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcDOGtj9A42zj8m3wWapg%2Fuploads%2FuVM4Ddr11ok3IE0p2DEU%2Fapi-json.json?alt=media&token=2fceb582-a2c0-410c-8878-7b013ce64aaf>" path="/api/receipt/create" method="post" %}
[api-json.json](https://3852815132-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcDOGtj9A42zj8m3wWapg%2Fuploads%2FuVM4Ddr11ok3IE0p2DEU%2Fapi-json.json?alt=media\&token=2fceb582-a2c0-410c-8878-7b013ce64aaf)
{% endopenapi %}

***

## Exemplo cURL

```bash
curl -X 'POST' \
  'https://apim.niiw.io/api/receipt/create' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJh...........' \
  -H 'Content-Type: application/json' \
  -d '{ "accessCode": "35230306057223024437590001419202251523787109" }'
```

## Exemplo Request Body

Segue abaixo alguns exemplos e formatos permitidos na API

#### Código de Acesso

Somente o código de acesso da nota fiscal

```json
{
  "accessCode":"35230306057223024437590001419202251523787109"
}
```

#### Tipo de input MANUAL&#x20;

Este formato geralmente usado quando não há uma captura pela camera do celular

```json
{
  "input": "MANUAL", 
  "accessCode":"35230306057223024437590001419202251523787109"
}
```

#### Tipo de input QRCODE com URL

Este formato geralmente ocorre pelo captura do QRCode da nota fiscal pela camera do celular

```json
{
  "input": "QRCODE", 
  "qrcode": "https://sat.sef.sc.gov.br/nfce/consulta?p=42230909477652004850651290000241741783194505|2|1|1|7FF3A80467D56F8221C2C3E78506367FAF3236C6"
}
```

**Tipo de input QRCODE com strings concatenadas**

Este formato geralmente ocorre na leitura de notas SAT

```json
{
  "input": "QRCODE", 
  "qrcode": "CFe35230306057223024437590001419202251523787109|20230319100758|958.53||K4r6J2dl6c1GrVcsqdx3OqqwFgz+z3Xr8U5NMAixZM4V0q8I4auMC9jgCwpW/GwCJjyGYYcJx5ihtX321AZ+XVUFs3g57nUGJhLZuda5L1whYBDy+sibSUhio6tWWD1JSFfwXKbj+UvEj/LH5onxDYRBox3nFLobaJN7LksE+EmvnhiHppJgyrQCRe/uzRidwyzbFpFtvglI/rNYxAj1rnoDhJdhkVy6M1CT9h6/1tmczGJ1oe2Mx2gxl6jF0Hc5yYF+teG/k69H32lvVvFyIP1QWDEk14lMdAnVR4Kb1+jwbQnfXIRWLzvDV+4kUAaKKNgqKkd5NVz2N38PCKiXRw=="
}
```

## Exemplo Response Body

```json
{
  "id": "65045.............."
}
```


---

# 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://developer.niiw.io/api-reference/nota-fiscal/adicionar-da-nota-fiscal.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.
