> ## 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.

# Update your tax issuer

> Updates the configuration of the tax issuer of the organization, in both environments.

This replaces the configuration of the `TEST` (homologation) and the `LIVE` (production) environment, so send both `homologationProperties` and `productionProperties` in full. The organization's own data (CNPJ, legal name, address, phone) is taken again from its registration in Portão 3 and sent to the tax provider together with the new configuration. Omitting a `taxConfiguration` keeps the stored one.

The RPS numbers you send (`nfeSequencialCode`, `nfeSequencialBatch`) restart the tax provider's numbering for that environment. Get your tax issuer returns the numbers set last, not the current ones (they are not advanced as documents are issued), so send the number your city hall expects next — never the value read back unchanged.

When `isSimplesNacional` is `false` in an environment, the `taxConfiguration` of that environment must carry `taxClassification`, `operationIndicatorCode` and `nationalTaxCode`. The value of `isSimplesNacional` in `productionProperties` is the one registered with the tax provider. The tax issuer must be active.

If the tax provider rejects the request, the error is returned with the provider's error `code` and a status of 400, 409, 422 or 502.


## OpenAPI

````yaml /api-reference/accounting.openapi.json patch /realms/{realmId}/organizations/{organizationId}/tax-issuer
openapi: 3.0.3
info:
  title: Accounting
  version: 1.0.0
  description: >-
    Portão 3 accounting 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). NFSe issuance: the
    organization's tax issuer (setup, certificate, logo), its tax documents
    (issue, list, download, cancel, CSV batches) and the city special-tax-regime
    lookup. Every route validates path, query, body and multipart form through a
    zod Input class (`accounting/app/use-case/*/inputs`), which documents it;
    responses are the named interfaces in
    `accounting/app/use-case/*/outputs/*Response.ts`. Confidence tiers:
    generated:typed=24 copied:manual=0 unknown=0.
servers:
  - url: https://api.accounting.v2.portao3.com.br/
    description: production
  - url: https://api.accounting.dev.3pers.com.br/
    description: development
security: []
tags:
  - name: Tax Issuers
  - name: Tax Documents (NFSe)
  - name: Tax Codes
paths:
  /realms/{realmId}/organizations/{organizationId}/tax-issuer:
    patch:
      tags:
        - Tax Issuers
      summary: Update your tax issuer
      description: >-
        Updates the configuration of the tax issuer of the organization, in both
        environments.
      operationId: patchRealmsByRealmIdOrganizationsByOrganizationIdTaxIssuer
      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.

            Format: `UUID`
          schema:
            type: string
            format: uuid
          example: c4bd3f21-dfbd-44e8-8055-68ba15bed410
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                homologationProperties:
                  type: object
                  properties:
                    specialTaxCode:
                      type: integer
                      description: >-
                        Code of the special taxation regime of your city: the
                        `id` of one of the regimes `GET
                        /taxCode/{specialTaxCode}` lists. Send it as the integer
                        or as the string `GET` returns.
                      example: 1
                    municipalServiceCode:
                      type: string
                      minLength: 1
                      description: >-
                        Municipal service code, as your city hall defines it for
                        the service you provide.
                      example: '0107'
                    serviceListItem:
                      type: string
                      minLength: 1
                      description: >-
                        Item of the federal service list (LC 116/2003) that
                        describes your service, such as `1.07`.
                      example: '1.07'
                    issTax:
                      type: number
                      description: >-
                        ISS (municipal service tax) rate in percent: `2.5` means
                        2.5%. Rounded to 2 decimal places.
                      example: 2.5
                    serviceDescription:
                      type: string
                      minLength: 1
                      description: Description of the service you provide.
                      example: Licenciamento de software como serviço (SaaS)
                    hasCulturalIncentive:
                      type: boolean
                      description: >-
                        Whether your organization is a cultural incentivizer
                        (`incentivador cultural`).
                      example: false
                    isSimplesNacional:
                      type: boolean
                      description: >-
                        Whether your organization is under the Simples Nacional
                        tax regime. When `false`, `taxConfiguration` is required
                        with `taxClassification`, `operationIndicatorCode` and
                        `nationalTaxCode`, otherwise the request fails with
                        `TAX_CONFIGURATION_INCOMPLETE`.
                      example: true
                    nfeSequencialCode:
                      type: integer
                      description: >-
                        RPS (provisional service receipt) number the tax
                        provider continues from in the test environment.
                        Integer. It RESETS the numbering: send the number your
                        city hall expects next — the value in Get your tax
                        issuer is the one set last, not the current one.
                      example: 1
                    nfeSeries:
                      type: string
                      minLength: 1
                      maxLength: 5
                      description: >-
                        Series of the RPS issued in the test environment. Up to
                        5 characters.
                      example: '1'
                    nfeSequencialBatch:
                      type: integer
                      description: >-
                        RPS batch number the tax provider continues from in the
                        test environment. Integer. It resets the batch
                        numbering, like `nfeSequencialCode`.
                      example: 1
                    cnae:
                      type: integer
                      description: >-
                        CNAE subclass code of your main activity. It must be an
                        existing CNAE code, otherwise the request fails with
                        `CNAE_NOT_FOUND`. Send it as the integer or as the
                        string.
                      example: 6201501
                    taxConfiguration:
                      description: >-
                        National NFSe tax fields of the LC 214/2025 reform.
                        Required when `isSimplesNacional` is `false`. When
                        omitted, the stored value is kept; when sent, it
                        replaces the stored one.
                      type: object
                      properties:
                        nbsCode:
                          description: >-
                            NBS code (`Nomenclatura Brasileira de Serviços`) of
                            your service. Optional.
                          example: '115090000'
                          type: string
                        nationalTaxCode:
                          description: >-
                            National tax code (`código de tributação nacional`)
                            of your service. Required when `isSimplesNacional`
                            is `false`.
                          example: '010701'
                          type: string
                        taxClassification:
                          description: >-
                            Tax classification (`classificação tributária`) of
                            the operation. Required when `isSimplesNacional` is
                            `false`.
                          example: '000001'
                          type: string
                        operationIndicatorCode:
                          description: >-
                            Operation indicator (`indicador de operação`) code.
                            Required when `isSimplesNacional` is `false`.
                          example: '100301'
                          type: string
                      additionalProperties: false
                  required:
                    - specialTaxCode
                    - municipalServiceCode
                    - serviceListItem
                    - issTax
                    - serviceDescription
                    - hasCulturalIncentive
                    - isSimplesNacional
                    - nfeSequencialCode
                    - nfeSeries
                    - nfeSequencialBatch
                    - cnae
                  additionalProperties: false
                  description: >-
                    Configuration of the test (homologation) environment:
                    documents issued here have no fiscal value. Replaces the
                    stored configuration, so send every field.
                productionProperties:
                  type: object
                  properties:
                    specialTaxCode:
                      type: integer
                      description: >-
                        Code of the special taxation regime of your city: the
                        `id` of one of the regimes `GET
                        /taxCode/{specialTaxCode}` lists. Send it as the integer
                        or as the string `GET` returns.
                      example: 1
                    municipalServiceCode:
                      type: string
                      minLength: 1
                      description: >-
                        Municipal service code, as your city hall defines it for
                        the service you provide.
                      example: '0107'
                    serviceListItem:
                      type: string
                      minLength: 1
                      description: >-
                        Item of the federal service list (LC 116/2003) that
                        describes your service, such as `1.07`.
                      example: '1.07'
                    issTax:
                      type: number
                      description: >-
                        ISS (municipal service tax) rate in percent: `2.5` means
                        2.5%. Rounded to 2 decimal places.
                      example: 2.5
                    serviceDescription:
                      type: string
                      minLength: 1
                      description: Description of the service you provide.
                      example: Licenciamento de software como serviço (SaaS)
                    hasCulturalIncentive:
                      type: boolean
                      description: >-
                        Whether your organization is a cultural incentivizer
                        (`incentivador cultural`).
                      example: false
                    isSimplesNacional:
                      type: boolean
                      description: >-
                        Whether your organization is under the Simples Nacional
                        tax regime. When `false`, `taxConfiguration` is required
                        with `taxClassification`, `operationIndicatorCode` and
                        `nationalTaxCode`, otherwise the request fails with
                        `TAX_CONFIGURATION_INCOMPLETE`. The value you send here
                        is also the one registered with the tax provider.
                      example: true
                    nfeSequencialCode:
                      type: integer
                      description: >-
                        RPS (provisional service receipt) number the tax
                        provider continues from in the live environment.
                        Integer. It RESETS the numbering: send the number your
                        city hall expects next — the value in Get your tax
                        issuer is the one set last, not the current one.
                      example: 1
                    nfeSeries:
                      type: string
                      minLength: 1
                      maxLength: 5
                      description: >-
                        Series of the RPS issued in the live environment. Up to
                        5 characters.
                      example: '1'
                    nfeSequencialBatch:
                      type: integer
                      description: >-
                        RPS batch number the tax provider continues from in the
                        live environment. Integer. It resets the batch
                        numbering, like `nfeSequencialCode`.
                      example: 1
                    cnae:
                      type: integer
                      description: >-
                        CNAE subclass code of your main activity. It must be an
                        existing CNAE code, otherwise the request fails with
                        `CNAE_NOT_FOUND`. Send it as the integer or as the
                        string.
                      example: 6201501
                    taxConfiguration:
                      description: >-
                        National NFSe tax fields of the LC 214/2025 reform.
                        Required when `isSimplesNacional` is `false`. When
                        omitted, the stored value is kept; when sent, it
                        replaces the stored one.
                      type: object
                      properties:
                        nbsCode:
                          description: >-
                            NBS code (`Nomenclatura Brasileira de Serviços`) of
                            your service. Optional.
                          example: '115090000'
                          type: string
                        nationalTaxCode:
                          description: >-
                            National tax code (`código de tributação nacional`)
                            of your service. Required when `isSimplesNacional`
                            is `false`.
                          example: '010701'
                          type: string
                        taxClassification:
                          description: >-
                            Tax classification (`classificação tributária`) of
                            the operation. Required when `isSimplesNacional` is
                            `false`.
                          example: '000001'
                          type: string
                        operationIndicatorCode:
                          description: >-
                            Operation indicator (`indicador de operação`) code.
                            Required when `isSimplesNacional` is `false`.
                          example: '100301'
                          type: string
                      additionalProperties: false
                  required:
                    - specialTaxCode
                    - municipalServiceCode
                    - serviceListItem
                    - issTax
                    - serviceDescription
                    - hasCulturalIncentive
                    - isSimplesNacional
                    - nfeSequencialCode
                    - nfeSeries
                    - nfeSequencialBatch
                    - cnae
                  additionalProperties: false
                  description: >-
                    Configuration of the live (production) environment:
                    documents issued here are legally valid. Replaces the stored
                    configuration, so send every field.
              required:
                - homologationProperties
                - productionProperties
              additionalProperties: false
      responses:
        '204':
          description: No Content. The operation succeeded and the response has no body.
        '400':
          description: >-
            `TAX_CONFIGURATION_INCOMPLETE` — `isSimplesNacional` is `false` in
            an environment whose `taxConfiguration` is missing, or lacks
            `taxClassification`, `operationIndicatorCode` or `nationalTaxCode`.


            `TAX_ISSUER_PROVIDER_ID_NOT_FOUND` — The tax issuer is not
            registered with the tax provider yet.
          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:
                      - TAX_CONFIGURATION_INCOMPLETE
                      - TAX_ISSUER_PROVIDER_ID_NOT_FOUND
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - ACCOUNTING
                    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: TAX_CONFIGURATION_INCOMPLETE
                origin: ACCOUNTING
                message: >-
                  The fields `Tax Situation` and `Tax Classification` are
                  mandatory for issuers that are not of the `Simples Nacional`
                  type. The fields `codigoTributacaoNacional` and `codigoNBS`
                  are optional.
        '403':
          description: '`TAX_ISSUER_INACTIVE` — The tax issuer is not active.'
          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:
                      - TAX_ISSUER_INACTIVE
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - ACCOUNTING
                    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: TAX_ISSUER_INACTIVE
                origin: ACCOUNTING
                message: >-
                  Tax issuer is deactivated. You do not have permission to
                  perform this action.
        '404':
          description: >-
            `TAX_ISSUER_NOT_FOUND` — The organization has no tax issuer.


            `ORGANIZATION_NOT_FOUND` — The organization does not exist in your
            realm.


            `CNAE_NOT_FOUND` — The `cnae` of an environment is not an existing
            CNAE code.


            `ISSUER_PROPERTIES_NOT_FOUND` — The tax issuer is missing its test
            or its live 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:
                      - TAX_ISSUER_NOT_FOUND
                      - ORGANIZATION_NOT_FOUND
                      - CNAE_NOT_FOUND
                      - ISSUER_PROPERTIES_NOT_FOUND
                    description: >-
                      Stable, machine-readable error code. Branch on this, never
                      on `message`.
                  origin:
                    type: string
                    enum:
                      - ACCOUNTING
                    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: TAX_ISSUER_NOT_FOUND
                origin: ACCOUNTING
                message: Tax issuer not found
        '422':
          description: >-
            `BAD_REQUEST` — A path parameter is not a valid ID or the body
            failed validation; `fields` lists each offending field.
          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:
                      - ACCOUNTING
                    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: ACCOUNTING
                message: >-
                  Bad Request: Your request is invalid or incomplete. Please
                  make sure you are requesting with the right fields.
                fields:
                  - field: homologationProperties
                    message: 'Invalid input: expected object, received undefined'
                    code: HOMOLOGATIONPROPERTIES_REQUIRED

````

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