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

# Update Customer

> Update Customer

<Info>
  The `PATCH` request is used to partially update an existing entity by the
  given id. This means:

  * Only the fields provided in the request body will be updated.
  * Fields not provided in the request body will remain unchanged.
  * The request is idempotent, meaning multiple identical PATCH requests will
    always result in the same final state.
</Info>


## OpenAPI

````yaml patch /v1/customers/{id}
openapi: 3.0.0
info:
  description: Open API's for WizCommerce API's
  title: WizCommerce Open API's
  termsOfService: https://wizcommerce.com/terms/
  contact:
    name: Tech Support
    url: https://help.wizcommerce.com/
    email: tech@wizcommerce.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: '1.0'
servers:
  - url: https://api.wizcommerce.com
    description: Production BaseURL
  - url: https://api-staging.sourcerer.tech
    description: Staging BaseURL
security: []
paths:
  /v1/customers/{id}:
    patch:
      tags:
        - Customer
      summary: Update Customer
      description: Update Customer
      parameters:
        - description: id
          name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/dtos.CustomerUpdateRequest'
        description: request
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/dtos.SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/dtos.CustomerDetailsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    dtos.CustomerUpdateRequest:
      type: object
      properties:
        company_name:
          type: string
          maxLength: 255
          x-order: '1'
          example: Company Name
        display_name:
          type: string
          maxLength: 255
          x-order: '2'
          example: Customer Display Name
        display_id:
          description: >-
            This is the display ID of the customer, it is generated by the
            system if not provided.
          type: string
          maxLength: 255
          x-order: '2'
          example: '1234567890'
        freight_term:
          type: string
          maxLength: 255
          x-order: '3'
        shipping_method:
          type: string
          maxLength: 255
          x-order: '4'
        payment_mode:
          type: string
          maxLength: 255
          x-order: '5'
        payment_term:
          type: string
          maxLength: 255
          x-order: '6'
        primary_contact_id:
          type: string
          x-order: '7'
        default_shipping_address_id:
          type: string
          x-order: '8'
        default_billing_address_id:
          type: string
          x-order: '9'
        reference_id:
          type: string
          maxLength: 255
          x-order: '10'
          example: CUS123
        assigned_sales_rep_ids:
          description: >-
            List of sales rep ids, sales rep id is a uuid can be queried from
            sales rep api
          type: array
          minItems: 1
          items:
            type: string
          x-order: '11'
        assigned_price_list_id:
          description: Price list id is a uuid can be queried from price list api
          type: string
          x-order: '12'
        first_name:
          type: string
          maxLength: 255
          x-order: '13'
          example: John
        last_name:
          type: string
          maxLength: 255
          x-order: '14'
          example: Doe
        phone:
          description: Phone number in E.164 format
          type: string
          x-order: '15'
          example: '+14155552671'
        email:
          type: string
          x-order: '16'
          example: john.doe@example.com
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/dtos.CustomerAddressUpdateRequest'
          x-order: '17'
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/dtos.CustomerContactUpdateRequest'
          x-order: '18'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/dtos.AttributeRequest'
          x-order: '19'
    dtos.SuccessResponse:
      type: object
      properties:
        data:
          x-order: '1'
    dtos.CustomerDetailsResponse:
      type: object
      properties:
        id:
          description: UUID
          type: string
          x-order: '1'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        reference_id:
          type: string
          x-order: '2'
          example: '1234567890'
        display_id:
          type: string
          x-order: '3'
          example: WC_1234567890
        name:
          type: string
          x-order: '4'
          example: Customer Name
        display_name:
          type: string
          x-order: '5'
          example: Customer Display Name
        first_name:
          type: string
          x-order: '6'
          example: John
        last_name:
          type: string
          x-order: '7'
          example: Doe
        phone:
          type: string
          x-order: '8'
          example: '+14155552671'
        email:
          type: string
          x-order: '9'
          example: john.doe@example.com
        status:
          type: string
          x-order: '10'
          example: active
        freight_term:
          type: string
          x-order: '11'
          example: Cust. Pickup
        shipping_method:
          type: string
          x-order: '12'
          example: DHL
        payment_mode:
          type: string
          x-order: '13'
          example: AMEX
        payment_term:
          type: string
          x-order: '14'
          example: NET30
        assigned_sales_reps:
          type: array
          items:
            $ref: '#/components/schemas/dtos.UserResponse'
          x-order: '15'
        assigned_price_list:
          allOf:
            - $ref: '#/components/schemas/dtos.CustomerPriceListResponse'
          x-order: '16'
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/dtos.AddressDetailsResponse'
          x-order: '17'
        contacts:
          type: array
          items:
            $ref: '#/components/schemas/dtos.ContactDetailsResponse'
          x-order: '18'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/attribute.AttributeValueResponse'
          x-order: '19'
        created_at:
          type: string
          x-order: '20'
          example: '2025-01-01T15:04:05Z'
        updated_at:
          type: string
          x-order: '21'
          example: '2025-01-01T15:04:05Z'
    errors.HttpError:
      type: object
      properties:
        code:
          type: string
          x-order: '1'
        message:
          type: string
          x-order: '2'
        details:
          type: array
          items:
            $ref: '#/components/schemas/errors.HttpErrorDetails'
          x-order: '3'
    dtos.CustomerAddressUpdateRequest:
      type: object
      required:
        - id
      properties:
        reference_id:
          type: string
          maxLength: 255
          x-order: '1'
          example: ADDR123
        first_name:
          type: string
          maxLength: 50
          x-order: '2'
          example: John
        last_name:
          type: string
          maxLength: 50
          x-order: '3'
          example: Doe
        phone:
          description: Phone number in E.164 format
          type: string
          x-order: '4'
          example: '+14155552671'
        email:
          type: string
          x-order: '5'
          example: john.doe@example.com
        address_line_1:
          type: string
          maxLength: 255
          x-order: '6'
          example: 123 Main St
        address_line_2:
          type: string
          maxLength: 255
          x-order: '7'
          example: Apt 101
        city:
          type: string
          maxLength: 50
          x-order: '8'
          example: Anytown
        state:
          type: string
          maxLength: 50
          x-order: '9'
          example: CA
        country:
          description: Country code in ISO 3166-1 alpha-2 format, e.g. US, IN, etc.
          type: string
          x-order: '10'
          example: US
        zip_code:
          type: string
          maxLength: 50
          x-order: '11'
          example: '12345'
        type:
          type: string
          enum:
            - billing
            - shipping
          x-order: '12'
          example: billing
        is_default:
          description: Default address for the customer
          type: boolean
          x-order: '13'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/dtos.AttributeRequest'
          x-order: '14'
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
    dtos.CustomerContactUpdateRequest:
      type: object
      required:
        - id
      properties:
        reference_id:
          type: string
          maxLength: 255
          x-order: '1'
          example: CUS123
        first_name:
          type: string
          maxLength: 50
          x-order: '2'
          example: John
        last_name:
          type: string
          maxLength: 50
          x-order: '3'
          example: Doe
        email:
          type: string
          x-order: '4'
          example: john.doe@example.com
        phone:
          description: Phone number in E.164 format
          type: string
          x-order: '5'
          example: '+14155552671'
        designation:
          type: string
          maxLength: 50
          x-order: '6'
          example: Sales Manager
        is_default:
          description: Default contact for the customer
          type: boolean
          x-order: '8'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/dtos.AttributeRequest'
          x-order: '9'
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
    dtos.AttributeRequest:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
          maxLength: 255
          x-order: '1'
          example: '1234567890'
        value:
          type: string
          x-order: '2'
          example: red
    dtos.UserResponse:
      type: object
      properties:
        id:
          type: string
          x-order: '1'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        email:
          type: string
          x-order: '2'
          example: john.doe@example.com
        first_name:
          type: string
          x-order: '3'
          example: John
        last_name:
          type: string
          x-order: '4'
          example: Doe
        phone:
          type: string
          x-order: '5'
          example: '+14155552671'
        department:
          type: string
          x-order: '6'
          example: Sales
        status:
          type: string
          x-order: '7'
          example: active
        created_by:
          type: string
          x-order: '8'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        updated_by:
          type: string
          x-order: '9'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        created_at:
          type: string
          x-order: '10'
          example: '2021-01-01T00:00:00Z'
        updated_at:
          type: string
          x-order: '11'
          example: '2021-01-01T00:00:00Z'
    dtos.CustomerPriceListResponse:
      type: object
      properties:
        id:
          type: string
          x-order: '1'
          example: 0c05a9a7-84ed-46f0-819b-653545730920
        name:
          type: string
          x-order: '2'
          example: Price List 1
        status:
          type: string
          x-order: '3'
          example: active
        reference_id:
          type: string
          x-order: '5'
          example: PRC-20250101
        description:
          type: string
          x-order: '7'
          example: Price List 1 Description
        created_at:
          type: string
          x-order: '8'
          example: '2025-01-01T00:00:00Z'
        updated_at:
          type: string
          x-order: '9'
          example: '2025-01-01T00:00:00Z'
    dtos.AddressDetailsResponse:
      type: object
      properties:
        id:
          type: string
          x-order: '1'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        customer_id:
          type: string
          x-order: '2'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        reference_id:
          type: string
          x-order: '3'
          example: ADDR123
        address_line_1:
          type: string
          x-order: '4'
          example: 123 Main St
        address_line_2:
          type: string
          x-order: '5'
          example: Apt 101
        city:
          type: string
          x-order: '6'
          example: Anytown
        state:
          type: string
          x-order: '7'
          example: CA
        country:
          description: Country code in ISO 3166-1 alpha-2 format, e.g. US, IN, etc.
          type: string
          x-order: '8'
          example: USA
        zip_code:
          type: string
          x-order: '9'
          example: '12345'
        first_name:
          type: string
          x-order: '10'
          example: John
        last_name:
          type: string
          x-order: '11'
          example: Doe
        phone:
          description: Phone number in E.164 format
          type: string
          x-order: '12'
          example: '+14155552671'
        email:
          type: string
          x-order: '13'
          example: john.doe@example.com
        type:
          type: string
          enum:
            - billing
            - shipping
          x-order: '14'
          example: billing
        status:
          type: string
          enum:
            - active
            - inactive
          x-order: '15'
          example: active
        is_default:
          type: boolean
          x-order: '16'
          example: false
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/attribute.AttributeValueResponse'
          x-order: '17'
        created_at:
          type: string
          x-order: '18'
          example: '2025-01-01T15:04:05Z'
        updated_at:
          type: string
          x-order: '19'
          example: '2025-01-01T15:04:05Z'
    dtos.ContactDetailsResponse:
      type: object
      properties:
        id:
          description: UUID
          type: string
          x-order: '1'
          example: 0c05a9a7-84ed-46f0-819b-653545730920
        reference_id:
          type: string
          x-order: '2'
          example: CUS123
        first_name:
          type: string
          x-order: '3'
          example: John
        last_name:
          type: string
          x-order: '4'
          example: Doe
        email:
          type: string
          x-order: '5'
          example: john.doe@example.com
        phone:
          type: string
          x-order: '6'
          example: '+14155552671'
        designation:
          type: string
          x-order: '7'
          example: Sales Manager
        status:
          type: string
          enum:
            - active
            - inactive
          x-order: '8'
          example: active
        is_default:
          type: boolean
          x-order: '9'
          example: false
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/attribute.AttributeValueResponse'
          x-order: '10'
        created_at:
          type: string
          x-order: '11'
          example: '2025-01-01T15:04:05Z'
        updated_at:
          type: string
          x-order: '12'
          example: '2025-01-01T15:04:05Z'
    attribute.AttributeValueResponse:
      type: object
      properties:
        id:
          type: string
          x-order: '1'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        name:
          type: string
          x-order: '2'
          example: Color
        value:
          type: string
          x-order: '3'
          example: Red
        created_by:
          type: string
          x-order: '4'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        updated_by:
          type: string
          x-order: '5'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        created_at:
          type: string
          x-order: '6'
          example: '2021-01-01T00:00:00Z'
        updated_at:
          type: string
          x-order: '7'
          example: '2021-01-01T00:00:00Z'
    errors.HttpErrorDetails:
      type: object
      properties:
        field:
          type: string
          x-order: '1'
        reason:
          type: string
          x-order: '2'
  securitySchemes:
    ApiKeyAuth:
      description: API Key for authentication
      type: apiKey
      name: X-API-Key
      in: header

````