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

# Record or clear an invoice issuing error

> Brazil only. Records on the replenishment the reason your invoicing system could not issue the
NF-e for it, so the problem is visible on the replenishment in Cubbo and can be followed up.
Send `invoice_issuing_error` with a message to record it, or omit it (or send `null`) to clear a
previously recorded error. The error is also cleared automatically when an invoice is attached.




## OpenAPI

````yaml /openapi.yaml patch /replenishments/{replenishment_id}/invoice-issuing-error
openapi: 3.1.0
info:
  title: Cubbo Clients API
  version: '1.0'
  summary: >-
    Orders, inventory, replenishments, returns, shipping and webhooks for Cubbo
    fulfillment.
  description: >
    The Cubbo Clients API connects your store, ERP or marketplace with Cubbo's
    fulfillment network.

    All endpoints except `POST /auth/token` require a bearer token; see the
    Authentication guide.

    Request and response bodies are JSON. Errors are JSON objects with an
    `error` key.
  contact:
    name: Cubbo integrations
    email: integraciones@cubbo.com
servers:
  - url: https://api.cubbo.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Exchange client credentials for a bearer token.
  - name: Orders
    description: Create, update, hold, cancel and read sales orders.
  - name: Shipping labels
    description: Read the shipping labels generated for an order.
  - name: Inventory
    description: Products and stock per store.
  - name: Lots
    description: Lot-level inventory for products with expiration or batch tracking.
  - name: Reports
    description: Bulk reports for reconciliation.
  - name: Replenishments
    description: Inbound shipments to the warehouse.
  - name: Returns
    description: Returns and exchanges.
  - name: Stores
    description: Store provisioning and settings.
  - name: Shipping methods
    description: Available shipping methods, coverage and quotes.
  - name: Click and collect
    description: Pickup points and in-store pickup orders.
paths:
  /replenishments/{replenishment_id}/invoice-issuing-error:
    patch:
      tags:
        - Replenishments
      summary: Record or clear an invoice issuing error
      description: >
        Brazil only. Records on the replenishment the reason your invoicing
        system could not issue the

        NF-e for it, so the problem is visible on the replenishment in Cubbo and
        can be followed up.

        Send `invoice_issuing_error` with a message to record it, or omit it (or
        send `null`) to clear a

        previously recorded error. The error is also cleared automatically when
        an invoice is attached.
      operationId: updateReplenishmentInvoiceIssuingError
      parameters:
        - name: replenishment_id
          in: path
          required: true
          description: Cubbo id of the replenishment.
          schema:
            type: integer
          example: 55001
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReplenishmentInvoiceIssuingErrorRequest'
            example:
              invoice_issuing_error: 'SEFAZ rejected the NF-e: recipient CNPJ not registered'
      responses:
        '200':
          description: Error recorded or cleared. Empty body.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                notFound:
                  value:
                    error: Couldn't find Replenishment with 'id'=55001
                invalidType:
                  value:
                    error: '''invoice_issuing_error'' is not a valid String'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - bearerAuth: []
components:
  schemas:
    ReplenishmentInvoiceIssuingErrorRequest:
      type: object
      properties:
        invoice_issuing_error:
          type:
            - string
            - 'null'
          description: >-
            Reason the NF-e could not be issued. Omit or send `null` to clear
            the recorded error.
          example: 'SEFAZ rejected the NF-e: recipient CNPJ not registered'
    Error:
      type: object
      description: Error body returned by every failed request.
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            Human-readable description of the failure. For `401` responses it is
            always `Unauthorized`.
          example: Parameter store_id is required
        message:
          type: string
          description: >-
            Present on `401` responses only; the reason the request was
            rejected.
          example: invalid token
        code:
          type:
            - string
            - 'null'
          description: >-
            Stable machine-readable code, present on some order, return and
            replenishment errors.
          example: ORDER_ALREADY_EXISTS
        context:
          type:
            - object
            - 'null'
          description: >-
            Extra data about the failure when available, for example the id of
            the conflicting order.
          additionalProperties: true
          example:
            order_id: 987654
  responses:
    Unauthorized:
      description: >-
        Missing or invalid token, wrong credentials, or no access to the
        requested store.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalidToken:
              value:
                error: Unauthorized
                message: invalid token
            noHeader:
              value:
                error: Unauthorized
                message: no authorization header found
            storeNotAllowed:
              value:
                error: Unauthorized
                message: not allowed to show? this Store
    InternalServerError:
      description: >-
        Unexpected error. Retry with backoff; if it persists, send the timestamp
        to Cubbo support.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 'unexpected error, timestamp: 1760000000'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Token returned by `POST /auth/token`, sent as `Authorization: Bearer
        <token>`.

````

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