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

# Update invoice fields

> Update invoice fields:
  * __dunning__ - Update dunning properties.
  * __dueDate__ - Update invoice due date.
Note: It is not possible to update both dunning and dueDate in the same request, as there are no invoice statuses that allow both updates simultaneously.




## OpenAPI

````yaml invoice patch /v1/{id}
openapi: 3.0.3
info:
  description: Endpoint for doing doing operations on a invoice
  version: '1'
  title: Invoice API
  contact:
    name: Enfuce Financial Services
    url: https://enfuce.com
    email: info@enfuce.com
  x-logo:
    url: https://developer.enfuce.com/images/enfuce.svg
    altText: Enfuce logo
servers:
  - url: >-
      https://integration-api-cat2.{{environment}}.ext.{{realm}}.cia.enfuce.com/invoice
  - url: https://integration-api-cat2.live.ext.prod.cia.enfuce.com/invoice
    description: Live environment
security: []
tags:
  - name: Get invoice information
    description: <p>Endpoints for fetching invoice information</p>
  - name: Update an invoice
    description: >-
      <p>Endpoints for updating invoice information</p><hr><p>As for now only
      the dunning properties and invoice due date can be updated. Please not
      that in order to update dunning properties - dunning should be enabled for
      the institution</p>
paths:
  /v1/{id}:
    patch:
      tags:
        - Update an invoice
      summary: Update invoice fields
      description: >
        Update invoice fields:
          * __dunning__ - Update dunning properties.
          * __dueDate__ - Update invoice due date.
        Note: It is not possible to update both dunning and dueDate in the same
        request, as there are no invoice statuses that allow both updates
        simultaneously.
      operationId: updateInvoiceUsingPATCH
      parameters:
        - name: id
          in: path
          description: Invoice id for given invoice
          required: true
          schema:
            type: string
        - name: auditUser
          in: query
          description: The audit user to log the request
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateInvoiceUsingPATCHRequest'
      responses:
        '200':
          description: Successfully updated invoice for given invoice id
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/resourceResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '404':
          description: Invoice does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
      deprecated: false
components:
  schemas:
    updateInvoiceUsingPATCHRequest:
      type: object
      properties:
        dueDate:
          type: string
          format: date
          description: Date when invoice is due
        dunning:
          $ref: '#/components/schemas/updateDunning'
      description: >-
        Request for updating invoice fields. Only provided fields will be
        updated.
    resourceResponse:
      type: object
      properties:
        description:
          type: string
          description: Short description of the result of the action
        id:
          type: string
          description: Will contain the ID of the resource that has been created or updated
      title: resourceResponse
    errorResponse:
      type: object
      properties:
        code:
          type: string
          description: An error code indicating what kind of error. I.e. HTTP error code
        message:
          type: string
          description: Error message in human-readable format
        id:
          type: string
          format: uuid
          description: Unique error identifier
        errorCode:
          type: string
          description: Enfuce code for a specific error type
        errorType:
          type: string
          description: Error type
          enum:
            - STATIC_VALIDATION_ERROR
            - DYNAMIC_VALIDATION_ERROR
            - INTEGRATION_ERROR
            - SECURITY_ERROR
            - UNEXPECTED_ERROR
        errorReason:
          type: string
          description: Free-form text explaining the error reason
        timestamp:
          type: string
          format: date-time
          description: Datetime when error occurred
    updateDunning:
      type: object
      properties:
        reminder1TriggerDate:
          type: string
          format: date
          example: '2019-11-27'
        blockTriggerDate:
          type: string
          format: date
          example: '2019-11-27'
        reminder2TriggerDate:
          type: string
          format: date
          example: '2019-11-27'
        collectionTriggerDate:
          type: string
          format: date
          example: '2019-11-27'
        dunningStatus:
          type: string
          enum:
            - STOPPED

````