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

# Update customer

> Updates an existing customer in the system.



## OpenAPI

````yaml /openAPI/openapi-20240301.json patch /customers/{customer_id}
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /customers/{customer_id}:
    patch:
      tags:
        - Customers
      summary: Update customer
      description: Updates an existing customer in the system.
      operationId: Update-customer
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            title: Customer Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCustomerRequestSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponseSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpdateCustomerRequestSchema:
      properties:
        external_id:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: External Id
          description: External Customer Id
        customer_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Name
          description: Customer name
        custom_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Custom Data
          description: Customer Custom Data
        address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
          description: Customer Address
        ship_to_address:
          anyOf:
            - $ref: '#/components/schemas/Address'
            - type: 'null'
          description: Customer Ship To Address
        tax_info:
          anyOf:
            - items:
                $ref: '#/components/schemas/TaxId'
              type: array
            - type: 'null'
          title: Tax Info
          description: Customer Tax Ids
        phone_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone Number
          description: Customer Phone Number
        email:
          anyOf:
            - type: string
              format: email
            - type: 'null'
          title: Email
          description: Customer primary email address
        connector:
          anyOf:
            - $ref: '#/components/schemas/app__customer__schema__Connector'
            - type: 'null'
          description: Connector
        communications_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Communications Enabled
          description: To enable/disable communications
        auto_charge_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Auto Charge Enabled
          description: To enable/disable auto-charge
        business_entity_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Business Entity Id
          description: Business Entity Id
      type: object
      title: UpdateCustomerRequestSchema
      description: Update Customer RequestSchema
    CustomerResponseSchema:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Customer Id
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Id
          description: External Customer Id
        customer_name:
          type: string
          title: Customer Name
          description: Customer name
        custom_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Custom Data
          description: Customer Custom Data
        address:
          anyOf:
            - $ref: '#/components/schemas/AddressResponse'
            - type: 'null'
          description: Customer Address
        ship_to_address:
          anyOf:
            - $ref: '#/components/schemas/AddressResponse'
            - type: 'null'
          description: Customer Ship To Address
        tax_info:
          anyOf:
            - items:
                $ref: '#/components/schemas/TaxId'
              type: array
            - type: 'null'
          title: Tax Info
          description: Customer Tax Ids
          default: []
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: Customer primary email address
        custom_attributes:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Custom Attributes
          description: Customer Tags
        phone_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone Number
          description: Customer Phone Number
        communications_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Communications Enabled
          description: To enable/disable communications
          default: true
        auto_charge_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Auto Charge Enabled
          description: To enable/disable auto-charge
          default: true
        business_entity_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Business Entity Id
          description: Business Entity Id
      type: object
      required:
        - id
        - external_id
        - customer_name
        - custom_data
        - address
      title: CustomerResponseSchema
      description: Create Customer Response Schema
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Address:
      properties:
        line1:
          anyOf:
            - type: string
            - type: 'null'
          title: Line1
          description: Street address line 1 (e.g., building number and street name)
        line2:
          anyOf:
            - type: string
            - type: 'null'
          title: Line2
          description: Street address line 2 (e.g., apartment, suite, unit number)
        line3:
          anyOf:
            - type: string
            - type: 'null'
          title: Line3
          description: Street address line 3 (additional address information)
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
          description: City or locality name
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
          description: State, province, or region
        zipCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Zipcode
          description: Postal code or ZIP code
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: Country name (e.g., 'United States')
        country_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Country Code
          description: Two-letter ISO country code (e.g., 'US', 'GB')
        validation_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Validation Status
          description: Address validation status
        connector_validation:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Connector Validation
          description: Validation data from external connector
      type: object
      title: Address
      description: Address Schema
    TaxId:
      properties:
        country_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Country Code
          description: Two-letter ISO country code for the tax ID (e.g., 'US', 'GB', 'IN')
        tax_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Code
          description: Type of tax identifier (e.g., 'VAT', 'GST', 'EIN')
        tax_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tax Id
          description: The actual tax identification number
      type: object
      title: TaxId
      description: Tax Id Schema
    app__customer__schema__Connector:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: >-
            Name of the external connector or integration (e.g., 'stripe',
            'salesforce')
        reference_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Reference Id
          description: Customer ID in the external system (e.g., Stripe customer ID)
      type: object
      title: Connector
    AddressResponse:
      properties:
        line1:
          anyOf:
            - type: string
            - type: 'null'
          title: Line1
          description: Street address line 1 (e.g., building number and street name)
        line2:
          anyOf:
            - type: string
            - type: 'null'
          title: Line2
          description: Street address line 2 (e.g., apartment, suite, unit number)
        line3:
          anyOf:
            - type: string
            - type: 'null'
          title: Line3
          description: Street address line 3 (additional address information)
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
          description: City or locality name
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
          description: State, province, or region
        zipCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Zipcode
          description: Postal code or ZIP code
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: Country name (e.g., 'United States')
        country_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Country Code
          description: Two-letter ISO country code (e.g., 'US', 'GB')
        validation_status:
          anyOf:
            - type: string
            - type: 'null'
          title: Validation Status
          description: Address validation status
        connector_validation:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Connector Validation
          description: Validation data from external connector
      type: object
      title: AddressResponse
      description: Address Schema
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiTokenAuth:
      type: apiKey
      in: header
      name: x-api-key
      x-default: <your-api-key>
    OrganisationAuth:
      type: apiKey
      in: header
      name: organisation
      x-default: <your-organisation-id>

````