- Distribuição ADN
- Sincronizar distribuição (ADN)
Distribuição ADN
Sincronizar distribuição (ADN)
Baixa da ADN, em lotes, todos os documentos novos desde o último NSU
POST
/nfse/distribute/sync
curl --request POST \
--url https://api.treeunfe.com.br/api/v1/nfse/distribute/sync \
--header 'x-api-key: <api-key>' \
--header 'x-api-key: <x_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"maxIterations": 123.45,
"maxDocuments": 123.45,
"cnpjConsulta": "<string>"
}'
curl --request POST \
--url https://api.treeunfe.com.br/api/v1/nfse/distribute/sync \
--header 'x-api-key: <api-key>' \
--header 'x-api-key: <x_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"maxIterations": 123.45,
"maxDocuments": 123.45,
"cnpjConsulta": "<string>"
}'Caminho recomendado para a distribuição. A Treeunfe retoma do último NSU baixado e consulta a ADN em lotes até ficar em dia ou atingir os limites (maxIterations / maxDocuments).
Dispara o webhook NFSE_DISTRIBUTION_BATCH a cada lote e NFSE_DISTRIBUTION_SYNC_COMPLETED ao terminar. Veja o guia Distribuição pela ADN.
Autenticação
x-api-key
required
string
API Key da empresa. A empresa precisa de certificado A1 válido.
Body
application/json
maxIterations
number
Máximo de consultas à ADN nesta chamada (1 a 50).
maxDocuments
number
Máximo de documentos nesta chamada (1 a 500).
cnpjConsulta
string
CNPJ do consulente (14 dígitos), se diferente do da empresa.
Respostas
| Status | Descrição |
|---|---|
200 | Sincronização concluída. |
401 | x-api-key ausente ou inválida. |
422 | Rejeição da ADN sem documentos. |
curl -X POST "https://api.treeunfe.com.br/api/v1/nfse/distribute/sync" \
-H "x-api-key: SUA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"maxIterations": 10,
"maxDocuments": 100
}'
curl -X POST "https://api.treeunfe.com.br/api/v1/nfse/distribute/sync" \
-H "x-api-key: SUA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"maxIterations": 10,
"maxDocuments": 100
}'
curl --request POST \
--url https://api.treeunfe.com.br/api/v1/nfse/distribute/sync \
--header 'x-api-key: <api-key>' \
--header 'x-api-key: <x_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"maxIterations": 123.45,
"maxDocuments": 123.45,
"cnpjConsulta": "<string>"
}'
curl --request POST \
--url https://api.treeunfe.com.br/api/v1/nfse/distribute/sync \
--header 'x-api-key: <api-key>' \
--header 'x-api-key: <x_api_key>' \
--header 'Content-Type: application/json' \
--data '{
"maxIterations": 123.45,
"maxDocuments": 123.45,
"cnpjConsulta": "<string>"
}'