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

# Update customer preferred payment method



## OpenAPI

````yaml /openapi.json put /customers/{customerId}/payment-methods/{paymentMethodId}/preferred
openapi: 3.0.0
info:
  title: Korint Documentation
  description: Korint API Documentation
  version: 1.0.0
  contact: {}
servers: []
security:
  - bearerAuth: []
tags: []
paths:
  /customers/{customerId}/payment-methods/{paymentMethodId}/preferred:
    put:
      tags:
        - customer
      summary: Update customer preferred payment method
      operationId: CustomerController_updatePreferredPaymentMethod
      parameters:
        - name: customerId
          required: true
          in: path
          description: the customer id
          schema:
            type: string
        - name: paymentMethodId
          required: true
          in: path
          schema:
            type: string
        - name: whenAt
          required: false
          in: query
          description: 'Optional: the whenAt datetime'
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatePreferredPaymentMethodOutput'
        '400':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/InvalidProductErrorDto'
                  - $ref: '#/components/schemas/InvalidPaymentMethodErrorDto'
              examples:
                INVALID_PRODUCT:
                  $ref: '#/components/schemas/InvalidProductErrorDto'
                INVALID_PAYMENT_METHOD:
                  $ref: '#/components/schemas/InvalidPaymentMethodErrorDto'
          description: ''
        '404':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/CustomerNotFoundErrorDto'
                  - $ref: '#/components/schemas/PaymentMethodNotFoundErrorDto'
              examples:
                CUSTOMER_NOT_FOUND:
                  $ref: '#/components/schemas/CustomerNotFoundErrorDto'
                PAYMENT_METHOD_NOT_FOUND:
                  $ref: '#/components/schemas/PaymentMethodNotFoundErrorDto'
          description: ''
        '409':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ConflictingConfigErrorDto'
                  - $ref: >-
                      #/components/schemas/ConflictingPaymentMethodStatusErrorDto
              examples:
                CONFLICTING_CONFIG:
                  $ref: '#/components/schemas/ConflictingConfigErrorDto'
                CONFLICTING_PAYMENT_METHOD_STATUS:
                  $ref: '#/components/schemas/ConflictingPaymentMethodStatusErrorDto'
          description: ''
components:
  schemas:
    UpdatePreferredPaymentMethodOutput:
      type: object
      properties: {}
    InvalidProductErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - INVALID_PRODUCT
        message:
          type: string
          example: Invalid product {product}
        details:
          $ref: '#/components/schemas/InvalidProductDetailsDto'
      required:
        - code
        - message
        - details
    InvalidPaymentMethodErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - INVALID_PAYMENT_METHOD
        message:
          type: string
          example: >-
            Invalid payment method {paymentMethod}, available methods are
            {allowedPaymentMethods}
        details:
          $ref: '#/components/schemas/InvalidPaymentMethodDetailsDto'
      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
    PaymentMethodNotFoundErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - PAYMENT_METHOD_NOT_FOUND
        message:
          type: string
          example: No payment method found for payment method id {paymentMethodId}
        details:
          $ref: '#/components/schemas/PaymentMethodNotFoundDetailsDto'
      required:
        - code
        - message
        - details
    ConflictingConfigErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CONFLICTING_CONFIG
        message:
          type: string
          example: Config field {configField} {requirement} {value} to perform {action}
        details:
          $ref: '#/components/schemas/ConflictingConfigDetailsDto'
      required:
        - code
        - message
        - details
    ConflictingPaymentMethodStatusErrorDto:
      type: object
      properties:
        code:
          type: string
          enum:
            - CONFLICTING_PAYMENT_METHOD_STATUS
        message:
          type: string
          example: >-
            {paymentMethodId} status {requirement} {paymentMethodStatus} to
            perform {action}
        details:
          $ref: '#/components/schemas/ConflictingPaymentMethodStatusDetailsDto'
      required:
        - code
        - message
        - details
    InvalidProductDetailsDto:
      type: object
      properties:
        tenant:
          type: string
        product:
          type: string
        expectedProduct:
          type: string
      required:
        - product
    InvalidPaymentMethodDetailsDto:
      type: object
      properties:
        paymentMethod:
          type: string
          enum:
            - card
            - sepa_debit
        allowedPaymentMethods:
          type: array
          items:
            type: string
            enum:
              - card
              - sepa_debit
      required:
        - paymentMethod
        - allowedPaymentMethods
    CustomerNotFoundDetailsDto:
      type: object
      properties:
        customerId:
          type: string
        branchId:
          type: string
        whenAt:
          type: string
        simulatedAt:
          type: string
      required:
        - customerId
    PaymentMethodNotFoundDetailsDto:
      type: object
      properties:
        paymentMethodId:
          type: string
      required:
        - paymentMethodId
    ConflictingConfigDetailsDto:
      type: object
      properties:
        configField:
          type: string
        requirement:
          allOf:
            - $ref: '#/components/schemas/OperationRequirement'
        value:
          type: string
        action:
          allOf:
            - $ref: '#/components/schemas/Action'
      required:
        - configField
        - requirement
        - value
        - action
    ConflictingPaymentMethodStatusDetailsDto:
      type: object
      properties:
        paymentMethodStatus:
          type: string
        paymentMethodId:
          type: string
        requirement:
          allOf:
            - $ref: '#/components/schemas/OperationRequirement'
        action:
          allOf:
            - $ref: '#/components/schemas/Action'
        additionalData:
          type: object
          additionalProperties: true
      required:
        - paymentMethodStatus
        - paymentMethodId
        - requirement
        - action
    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

````