> ## Documentation Index
> Fetch the complete documentation index at: https://developers.portao3.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Get the NFSe configuration

> Returns the organization's NFSe configuration: which billing event issues its service invoices (NFSe) automatically, and how they are filled in.

Only admins of the organization or of the realm can read it. An organization has at most one NFSe configuration; without one, no NFSe is issued automatically.


## OpenAPI

````yaml /api-reference/billing.openapi.json get /realms/{realmId}/organizations/{organizationId}/nfse-configs
openapi: 3.0.3
info:
  title: Billing
  version: 1.0.0
  description: >-
    Portão 3 billing API. Every endpoint requires a bearer token in the
    Authorization header (Authorization: Bearer <token>) unless its page states
    otherwise; see the Authentication guide. That requirement is not repeated
    per endpoint. Generated by tools/openapi from code (routes + security) and
    the hand-written spec (request/response bodies). Full billing surface —
    contracts, deals, invoices, statements, payment links, checkout and NFSe
    orchestration. (The product/supplier catalog moved to registry.) Confidence
    tiers: generated:typed=74 copied:manual=0 unknown=5.
servers:
  - url: https://api.billing.v2.portao3.com.br/
    description: production
  - url: https://api.billing.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Contracts
  - name: Deals
  - name: Invoices
  - name: Invoice Entries
  - name: Invoice Statements
  - name: NFSe Configuration
  - name: Payment Links
paths:
  /realms/{realmId}/organizations/{organizationId}/nfse-configs:
    get:
      tags:
        - NFSe Configuration
      summary: Get the NFSe configuration
      description: >-
        Returns the organization's NFSe configuration: which billing event
        issues its service invoices (NFSe) automatically, and how they are
        filled in.
      operationId: getRealmsByRealmIdOrganizationsByOrganizationIdNfseConfigs
      parameters:
        - name: realmId
          in: path
          required: true
          description: |-
            ID of your realm.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: f495ff0c-ab54-4f99-8e92-ca8682e4de9b
        - name: organizationId
          in: path
          required: true
          description: |-
            ID of the organization the NFSe configuration belongs to.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  event:
                    type: string
                    enum:
                      - INVOICE_PAID
                      - INVOICE_CLOSED
                      - PAYMENT_RECEIVED
                    description: >-
                      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).
                    example: INVOICE_PAID
                  issWithheldAtSource:
                    type: boolean
                    description: Whether the customer withholds the ISS at source.
                    example: false
                  environment:
                    type: string
                    enum:
                      - TEST
                      - LIVE
                    description: >-
                      `LIVE` for real NFSe, `TEST` for homologation documents
                      with no fiscal value.
                    example: LIVE
                  competence:
                    type: string
                    enum:
                      - EVENT_DATE
                      - CREATED_AT
                      - CLOSED_AT
                      - DUE_AT
                      - PAID_AT
                      - EFFECTIVE_AT
                    description: >-
                      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.
                    example: PAID_AT
                  observation:
                    type: string
                    description: >-
                      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:
                    type: string
                    description: >-
                      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
                  createdAt:
                    type: string
                    description: When the configuration was created.
                    example: '2026-08-07T19:45:17.204Z'
                    format: date-time
                required:
                  - event
                  - issWithheldAtSource
                  - environment
                  - createdAt
                description: The organization's NFSe configuration.
        '403':
          description: >-
            `INSUFFICIENT_PERMISSIONS` — You are not an admin of the
            organization or of the realm.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - INSUFFICIENT_PERMISSIONS
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BILLING
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: INSUFFICIENT_PERMISSIONS
                origin: BILLING
                message: insufficient permissions
        '404':
          description: >-
            `NFSE_CONFIG_NOT_FOUND` — The organization has no NFSe
            configuration.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - NFSE_CONFIG_NOT_FOUND
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BILLING
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: NFSE_CONFIG_NOT_FOUND
                origin: BILLING
                message: NFSE_CONFIG not found
        '422':
          description: >-
            `BAD_REQUEST` — A path parameter is not a valid ID; `fields` lists
            each one.
          content:
            application/json:
              schema:
                type: object
                properties:
                  traceId:
                    type: string
                    description: >-
                      Identifier of the request that failed. Quote it when
                      contacting support.
                    example: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                  code:
                    type: string
                    enum:
                      - BAD_REQUEST
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - BILLING
                    description: Service that produced the error.
                  message:
                    type: string
                    description: >-
                      Human-readable explanation. Its wording may change without
                      notice.
                  fields:
                    type: array
                    description: >-
                      One entry per invalid request field (validation errors
                      only).
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                          description: >-
                            Path of the invalid field, e.g. `label` or
                            `values[0].value`.
                          example: label
                        message:
                          type: string
                          description: Why the field was rejected.
                          example: label is required
                        code:
                          type: string
                          description: >-
                            `<FIELD>_<REASON>` — e.g. `LABEL_REQUIRED`,
                            `TYPE_ONE_OF`, `VALUES_VALUE_TYPE_ERROR`.
                          example: LABEL_REQUIRED
                        values:
                          type: array
                          items:
                            type: string
                          description: >-
                            The accepted values, when the field is an
                            enumeration.
                      required:
                        - field
                        - message
                        - code
                required:
                  - traceId
                  - code
                  - origin
                  - message
              example:
                traceId: 1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b
                code: BAD_REQUEST
                origin: BILLING
                message: >-
                  Bad Request: Your request is invalid or incomplete. Please
                  make sure you are requesting with the right fields.
                fields:
                  - field: organizationId
                    message: Invalid UUID
                    code: ORGANIZATIONID_UUID

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.