Skip to main content
POST
Create the NFSe configuration
Only admins of the organization or of the realm can create it. The organization needs an active tax issuer in the Accounting service first (POST /realms/{realmId}/organizations/{organizationId}/tax-issuer, with its test and live configurations), and it has at most one NFSe configuration: to change it, delete it and create a new one. The configuration is read when each event is processed, shortly after it happens, so an event processed while the organization has no configuration issues no NFSe, and it is not issued later. Each NFSe is issued in the background, after its event, and appears in the Accounting service’s tax document list (GET /realms/{realmId}/organizations/{organizationId}/tax-document). It is issued to the invoice’s payer: the CPF or CNPJ comes from the invoice, and the name, e-mail and address from the contract’s buyer when it has them. An invoice whose payer has no CPF or CNPJ issues none. The service data (city, ISS rate, municipal service code, LC 116 item, CNAE) comes from your tax issuer’s live configuration, also when environment is TEST, and the service description is the invoice’s description. With PAYMENT_RECEIVED, each payment settled on an invoice issues its own NFSe, for the amount of that payment. Payments you record by hand (POST .../invoices/{invoiceId}/statements and POST .../invoices/{invoiceId}/statements/settlement) issue none. Answers the configuration it created.

Path Parameters

realmId
string<uuid>
required

ID of your realm.

Format: UUID

organizationId
string<uuid>
required

ID of the organization that issues the NFSe. It needs an active tax issuer.

Format: UUID

Body

application/json
event
enum<string>
required

Which billing event issues an NFSe. INVOICE_CLOSED: one NFSe for the whole invoice, for its amount, when the invoice closes. INVOICE_PAID: one NFSe for the whole invoice, for its amount, when the invoice is paid. PAYMENT_RECEIVED: one NFSe for each payment settled on an invoice, for the amount of that payment.

Available options:
INVOICE_PAID,
INVOICE_CLOSED,
PAYMENT_RECEIVED
Example:

"INVOICE_PAID"

issWithheldAtSource
boolean
required

Whether the customer withholds the ISS at source. Sent on every NFSe this configuration issues.

Example:

false

environment
enum<string>
required

LIVE issues real NFSe. TEST issues homologation documents, which have no fiscal value; they carry the same service data, from your tax issuer's live configuration.

Available options:
TEST,
LIVE
Example:

"LIVE"

competence
enum<string>
required

Which date becomes the competence date of each NFSe (the date the service refers to), as a UTC calendar day. EVENT_DATE: the day the event happened. CREATED_AT: the day the invoice was created, or, with PAYMENT_RECEIVED, the day the payment was recorded. CLOSED_AT, DUE_AT, PAID_AT: the invoice's closing, due and payment dates (an invoice with no payment date uses the event date). EFFECTIVE_AT: the day the payment took effect. INVOICE_CLOSED and INVOICE_PAID accept EVENT_DATE, CREATED_AT, CLOSED_AT, DUE_AT and PAID_AT; PAYMENT_RECEIVED accepts EVENT_DATE, CREATED_AT and EFFECTIVE_AT. Any other combination is rejected.

Available options:
EVENT_DATE,
CREATED_AT,
CLOSED_AT,
DUE_AT,
PAID_AT,
EFFECTIVE_AT
Example:

"PAID_AT"

observation
string
required

Free text printed on every NFSe this configuration issues. Send an empty string to print none.

Example:

"Serviços prestados conforme contrato."

operationNature
string
required

Nature of the operation, stored with every NFSe this configuration issues but not printed on it. An empty string is accepted.

Example:

"Prestação de Serviços"

Response

Successful response

The organization's NFSe configuration.

event
enum<string>
required

Which billing event issues an NFSe: INVOICE_CLOSED (one per invoice, when it closes), INVOICE_PAID (one per invoice, when it is paid) or PAYMENT_RECEIVED (one per payment settled on an invoice).

Available options:
INVOICE_PAID,
INVOICE_CLOSED,
PAYMENT_RECEIVED
Example:

"INVOICE_PAID"

issWithheldAtSource
boolean
required

Whether the customer withholds the ISS at source.

Example:

false

environment
enum<string>
required

LIVE for real NFSe, TEST for homologation documents with no fiscal value.

Available options:
TEST,
LIVE
Example:

"LIVE"

createdAt
string<date-time>
required

When the configuration was created.

Example:

"2026-08-07T19:45:17.204Z"

competence
enum<string>

Which date becomes the competence date of each NFSe: EVENT_DATE, CREATED_AT, CLOSED_AT, DUE_AT, PAID_AT or EFFECTIVE_AT. Absent on a configuration created before this field existed: its NFSe take the day the invoice was last updated.

Available options:
EVENT_DATE,
CREATED_AT,
CLOSED_AT,
DUE_AT,
PAID_AT,
EFFECTIVE_AT
Example:

"PAID_AT"

observation
string

Free text printed on every NFSe. Absent on a configuration created before this field existed, which prints none.

Example:

"Serviços prestados conforme contrato."

operationNature
string

Nature of the operation, stored with every NFSe but not printed on it. Absent on a configuration created before this field existed, which stores Prestação de Serviços.

Example:

"Prestação de Serviços"