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

> Basic operation for updating an account. Check parameter updateProperty for possible parameters to update

<RequestExample>
  ```json Delete address request  theme={null}
  {
    "bodyTemplate": "string",
    "dummy": "string"
  }
  ```

  ```json Delete einvoice address and operator request  theme={null}
  {
    "bodyTemplate": "string",
    "dummy": "string"
  }
  ```

  ```json Write off request  theme={null}
  {
    "bodyTemplate": "string",
    "writeOffType": "WRITE_OFF"
  }
  ```
</RequestExample>


## OpenAPI

````yaml account post /v3/{id}/update/{propertyToUpdate}
openapi: 3.0.3
info:
  description: Endpoint for doing various actions connected to a account
  version: '1'
  title: Account details 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/account
  - url: https://integration-api-cat2.live.ext.prod.cia.enfuce.com/account
    description: Live environment
security: []
tags:
  - name: Create an account
    description: <p>Endpoints for creating an account</p>
  - name: Update an account
    description: <p>Endpoints for updating an account</p>
  - name: Get account information
    description: Endpoints for fetching an account
paths:
  /v3/{id}/update/{propertyToUpdate}:
    post:
      tags:
        - Update an account
      summary: Update account
      description: >-
        Basic operation for updating an account. Check parameter updateProperty
        for possible parameters to update
      operationId: updateAccountUsingPOST
      parameters:
        - name: id
          in: path
          description: The accountId of which account you want to update
          required: true
          schema:
            type: string
            format: biginteger
        - name: auditUser
          in: query
          description: The audit user to log the request
          required: true
          schema:
            type: string
        - name: propertyToUpdate
          in: path
          description: |
            What property you want to update
               * __DELETE_ADDRESS__ - Deletes address.
               * __WRITE_OFF__ - Write-off uncollectible debt for given account id and book it as a loss. **Only applicable for CREDIT accounts**.
               * __IMMEDIATE_ACCOUNT_CLOSE__ Immediately closes account. For the change to be effective, account to be closed must have zero balance. Also usage of this feature must be agreed to be enabled with Enfuce before it can be taken into use.
          required: true
          schema:
            type: string
            enum:
              - DELETE_ADDRESS
              - WRITE_OFF
              - IMMEDIATE_ACCOUNT_CLOSE
      requestBody:
        $ref: '#/components/requestBodies/updateResourceBody'
      responses:
        '200':
          description: Successful update of account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/resourceResponse'
        '400':
          description: Given property to update is invalid
          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: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errorResponse'
      deprecated: false
components:
  requestBodies:
    updateResourceBody:
      content:
        application/json:
          schema:
            discriminator:
              propertyName: bodyTemplate
              mapping:
                DELETE_ADDRESS:
                  $ref: '#/components/schemas/deleteAddressResourceBody'
                WRITE_OFF:
                  $ref: '#/components/schemas/writeOffResourceBody'
      description: >-
        Select the bodyTemplate of the propertyToUpdate to view possible
        properties needed in the request body of the request.
      required: false
  schemas:
    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
    deleteAddressResourceBody:
      allOf:
        - $ref: '#/components/schemas/updateResourceBody'
      title: DELETE_ADDRESS
    writeOffResourceBody:
      type: object
      properties:
        bodyTemplate:
          $ref: '#/components/schemas/bodyTemplate'
        writeOffType:
          type: string
          description: This value is optional, if not given `WRITE_OFF` is used.
          default: WRITE_OFF
          enum:
            - WRITE_OFF
            - WRITE_OFF_2
            - WRITE_OFF_3
            - WRITE_OFF_4
      title: WRITE_OFF
    updateResourceBody:
      type: object
      properties:
        bodyTemplate:
          $ref: '#/components/schemas/bodyTemplate'
        dummy:
          type: string
          description: Dummy value not used
      description: Should set the value of the property you are updating, leave rest empty
    bodyTemplate:
      type: string
      description: Request body template given based on selected property.

````