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

# Edit Customer



## OpenAPI

````yaml /openapi.json patch /customers/{customerId}
openapi: 3.0.0
info:
  title: Korint Documentation
  description: Korint API Documentation
  version: 1.0.0
  contact: {}
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /customers/{customerId}:
    patch:
      tags:
        - customer
      summary: Edit Customer
      operationId: CustomerController_editCustomer
      parameters:
        - name: customerId
          required: true
          in: path
          description: the customer's id
          schema:
            type: string
        - name: whenAt
          required: false
          in: query
          description: 'Optional: the whenAt datetime'
          schema:
            type: string
        - name: branchId
          required: false
          in: query
          description: 'Optional: the branchId'
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditCustomerInputBody'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EditCustomerOutput'
        '400':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/InvalidCustomFieldsErrorDto'
                  - $ref: '#/components/schemas/InvalidEventCreationDateErrorDto'
              examples:
                INVALID_CUSTOM_FIELDS:
                  $ref: '#/components/schemas/InvalidCustomFieldsErrorDto'
                INVALID_EVENT_CREATION_DATE:
                  $ref: '#/components/schemas/InvalidEventCreationDateErrorDto'
          description: ''
        '404':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/CompanyNotFoundErrorDto'
                  - $ref: '#/components/schemas/CustomerNotFoundErrorDto'
              examples:
                COMPANY_NOT_FOUND:
                  $ref: '#/components/schemas/CompanyNotFoundErrorDto'
                CUSTOMER_NOT_FOUND:
                  $ref: '#/components/schemas/CustomerNotFoundErrorDto'
          description: ''
        '409':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ConflictingPolicyStatusErrorDto'
                  - $ref: '#/components/schemas/ConflictingBranchStatusErrorDto'
                  - $ref: '#/components/schemas/FieldsDoNotMeetRequirementsErrorDto'
              examples:
                CONFLICTING_POLICY_STATUS:
                  $ref: '#/components/schemas/ConflictingPolicyStatusErrorDto'
                CONFLICTING_BRANCH_STATUS:
                  $ref: '#/components/schemas/ConflictingBranchStatusErrorDto'
                FIELDS_DO_NOT_MEET_REQUIREMENTS:
                  $ref: '#/components/schemas/FieldsDoNotMeetRequirementsErrorDto'
          description: ''
components:
  schemas:
    EditCustomerInputBody:
      type: object
      properties:
        customFields:
          description: custom fields per product
          type: array
          items:
            $ref: '#/components/schemas/NullableCustomFieldDto'
        name:
          type: string
          description: 'Optional: Name of the entity'
        role:
          type: string
          description: 'Optional: Customer business role'
        siret:
          type: string
          description: 'Optional: Siret number'
    EditCustomerOutput:
      type: object
      properties: {}
    InvalidCustomFieldsErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - INVALID_CUSTOM_FIELDS
        message:
          type: string
          example: Invalid custom fields
        details:
          $ref: '#/components/schemas/InvalidCustomFieldsDetailsDto'
      required:
        - code
        - message
        - details
    InvalidEventCreationDateErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - INVALID_EVENT_CREATION_DATE
        message:
          type: string
          example: >-
            You are trying to push an event that is created on {createdAt}, but
            the creation date should be after the latest event which was created
            on {latestCreatedAt}
        details:
          $ref: '#/components/schemas/InvalidEventCreationDateDetailsDto'
      required:
        - code
        - message
        - details
    CompanyNotFoundErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - COMPANY_NOT_FOUND
        message:
          type: string
          example: No company found for siret number {siret}
        details:
          $ref: '#/components/schemas/CompanyNotFoundDetailsDto'
      required:
        - code
        - message
        - details
    CustomerNotFoundErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CUSTOMER_NOT_FOUND
        message:
          type: string
          example: Customer {customerId} ({branchId}) not found
        details:
          $ref: '#/components/schemas/CustomerNotFoundDetailsDto'
      required:
        - code
        - message
        - details
    ConflictingPolicyStatusErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CONFLICTING_POLICY_STATUS
        message:
          type: string
          example: '{policyId} status {requirement} {policyStatus} to perform {action}'
        details:
          $ref: '#/components/schemas/ConflictingPolicyStatusDetailsDto'
      required:
        - code
        - message
        - details
    ConflictingBranchStatusErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CONFLICTING_BRANCH_STATUS
        message:
          type: string
          example: Branch status {requirement} {branchStatus} to perform {action}
        details:
          $ref: '#/components/schemas/ConflictingBranchStatusDetailsDto'
      required:
        - code
        - message
        - details
    FieldsDoNotMeetRequirementsErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - FIELDS_DO_NOT_MEET_REQUIREMENTS
        message:
          type: string
          example: >-
            Fields on this branch do not meet requirements defined in product
            configuration
        details:
          $ref: '#/components/schemas/FieldsRequirementsConflictDto'
      required:
        - code
        - message
        - details
    NullableCustomFieldDto:
      type: object
      properties:
        key:
          type: string
        value:
          oneOf:
            - type: string
            - type: number
            - type: boolean
          nullable: true
      required:
        - key
        - value
    InvalidCustomFieldsDetailsDto:
      type: object
      properties:
        productId:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/InvalidCustomFieldsDetailsErrorsDto'
      required:
        - errors
    InvalidEventCreationDateDetailsDto:
      type: object
      properties:
        createdAt:
          format: date-time
          type: string
        latestCreatedAt:
          format: date-time
          type: string
      required:
        - createdAt
        - latestCreatedAt
    CompanyNotFoundDetailsDto:
      type: object
      properties:
        siret:
          type: string
      required:
        - siret
    CustomerNotFoundDetailsDto:
      type: object
      properties:
        customerId:
          type: string
        branchId:
          type: string
        whenAt:
          type: string
        simulatedAt:
          type: string
      required:
        - customerId
    ConflictingPolicyStatusDetailsDto:
      type: object
      properties:
        policyStatus:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        policyId:
          type: string
        requirement:
          allOf:
            - $ref: '#/components/schemas/OperationRequirement'
        action:
          allOf:
            - $ref: '#/components/schemas/Action'
        additionalData:
          type: object
          additionalProperties: true
      required:
        - policyStatus
        - policyId
        - requirement
        - action
    ConflictingBranchStatusDetailsDto:
      type: object
      properties:
        branchStatus:
          allOf:
            - $ref: '#/components/schemas/BranchStatus'
        requirement:
          allOf:
            - $ref: '#/components/schemas/OperationRequirement'
        action:
          allOf:
            - $ref: '#/components/schemas/Action'
      required:
        - branchStatus
        - requirement
        - action
    FieldsRequirementsConflictDto:
      type: object
      properties: {}
    InvalidCustomFieldsDetailsErrorsDto:
      type: object
      properties:
        key:
          type: string
        errorDetails:
          type: array
          items:
            type: string
        value:
          type: object
      required:
        - key
        - errorDetails
    OperationRequirement:
      type: string
      enum:
        - must be
        - must NOT be
        - must contain
        - must NOT contain
    Action:
      type: string
      enum:
        - PERFORM THIS ACTION
        - CREATE POLICY
        - CREATE ASSET
        - CREATE ASSET WITH START DATE
        - REPLACE ASSET
        - REMOVE ASSET
        - CHOOSE ASSET OPTIONS
        - STOP ASSET
        - EDIT ASSET
        - EDIT ASSET WITH START DATE
        - CREATE BRANCH
        - CREATE DEROGATION
        - CREATE MTA BRANCH
        - FORK TO NEW MTA BRANCH
        - FORK TO NEW NB BRANCH
        - FORK TO NEW RENEWAL BRANCH
        - FORK TO NEW REPRICING BRANCH
        - DEFINE PARENT POLICY ID
        - INITIALIZE CUSTOMER
        - EDIT CUSTOMER
        - DELETE CUSTOMER FROM POLICY
        - DECLARE CLAIMS HISTORY
        - SIGN
        - EDIT POLICY
        - EDIT POLICY EXTERNAL ID
        - CONFIRM POLICY
        - QUOTE POLICY
        - RETRIEVING QUOTE
        - STOP POLICY
        - SUSPEND POLICY
        - ACTIVATE POLICY
        - GENERATE MANDATE SIGNATURE REQUEST
        - GENERATE PAYMENT METHOD SECRET
        - CREATE CLAIM
        - FINALIZE RENEWAL
        - SEND CONTRACT TO SIGNATURE
        - GENERATE SIGNATURE REQUEST
        - GENERATE DOCUMENTS FOR SIGNATURE
        - APPROVE DISTRIBUTION REQUEST
        - DENY DISTRIBUTION REQUEST
        - REVOKED_DISTRIBUTION_REQUEST
        - DELETE DISTRIBUTION REQUEST
        - WAITING FOR SIGNATURE DISTRIBUTION REQUEST
        - UPDATE POLICY QUOTE
    BranchStatus:
      type: string
      enum:
        - BRANCH_OPEN
        - BRANCH_MERGED
        - BRANCH_CLOSED

````