Swagger UI openapi.json openapi.yaml
Guide

Internal Endpoints ★

Admin-only and external-app-token endpoints. These routes hit the accounting service directly — they are not part of the public API surface.

Overview

The internal ★ group contains endpoints that bypass the core-contabeleza service and talk directly to the accounting service (Go). These are restricted to callers with an external-app-token or admin session.

On the endpoints page, internal endpoints are marked with a red badge. On the models page, internal models appear in a collapsed section at the bottom.

Do not use these endpoints from frontend code. They require admin-level authentication and are subject to change without notice.

Authentication

Internal endpoints accept two authentication methods:

MethodHeaderUse case
external-app-tokenAuthorization: Bearer <token>Service-to-service calls (n8n, internal tools)
admin sessionAuthorization: Bearer <jwt>Admin user logged into the platform

The ilm-business header is not required for most internal endpoints — the fiscal entity ID is embedded in the path.

Proxy vs direct routes

The Contabeleza platform has two types of routes that reach the accounting service:

TypePath patternHow it works
Proxy/fiscal-entities/*, /buyer-fiscal-entities/*API gateway → core-contabeleza → accounting service (RabbitMQ)
Direct/accounting/search/*, /accounting/callbacks/*, /accounting/diagnosis/*API gateway → accounting service directly (no core-contabeleza)

Proxy routes live at the root level. Direct routes have an /accounting/ prefix.

Path prefixes

Internal endpoints use three path prefixes:

PrefixDescriptionExample
/fiscal-entitiesSeller fiscal entities (CRUD, MEI, revenue, credentials)GET /fiscal-entities/{id}
/buyer-fiscal-entitiesBuyer fiscal entities (CRUD)GET /buyer-fiscal-entities/{id}
/accounting/searchInfoSimples lookups (address, fiscal info, municipal details)GET /accounting/search/address/{id}
/accounting/callbacksWebhook receivers (eNotas, Serpro, InfoSimples)POST /accounting/callbacks/enotas
/accounting/diagnosisMEI diagnosis endpointPOST /accounting/diagnosis

JSON:API type conventions

Internal endpoints return JSON:API responses. The type names use dashes (not underscores):

ModelJSON:API type
SellerFiscalEntityfiscal-entities
BuyerFiscalEntitybuyer-fiscal-entities
Invoiceinvoices
FiscalEntityMeifiscal-entity-meis
FiscalEntityMeiCndfiscal-entity-mei-cnds
FiscalEntityMeiDasnfiscal-entity-mei-dasns
FiscalEntityMeiCcmeifiscal-entity-mei-ccmeis
FiscalEntityRevenuefiscal-entity-revenues
FiscalEntityRevenueResumefiscal-entity-revenue-resumes
PassGovfiscal-entity-pass-govs
PassInvoicefiscal-entity-pass-invoices
FiscalEntityCertificatefiscal-entity-certificates
FiscalEntityRequestfiscal-entity-requests
Dasfiscal-entity-mei-dases
Diagnosisfiscal-entity-mei-diagnosis

Deprecated & broken routes

Two routes are marked deprecated: true in the spec:

MethodPathReason
POST/fiscal-entities/{id}/validate-emissionReplaced by the credential validation flow
GET/fiscal-entities/{id}/validation-statusReplaced by emission-status on the model

Two routes are excluded from the spec because they have no handler method in the accounting service:

MethodPathHandler
PUT/fiscal-entities/{id}/certificateadd_certificate — missing
POST/fiscal-entities/{id}/mei/cnpjupdate_cnpj — missing

Admin-only endpoint

One endpoint is restricted to admin callers only:

MethodPathDescription
GET/fiscal-entities/{id}/revalidateForce revalidation of a fiscal entity's credentials

This endpoint is tagged Privado and requires an admin JWT or external-app-token with admin permissions.