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

# Update an existing customer



## OpenAPI

````yaml POST /external/customer/{buyer_id}
openapi: 3.1.0
info:
  title: OpenAPI Valyx API
  description: To demonstrate features in the Valyx
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.valyx.com
security:
  - bearerAuth:
      - demo-api
tags:
  - name: billing
    description: External Billing APIs
  - name: external
    description: External APIs for customers
  - name: invoice
    description: Invoice APIs
  - name: creditNote
    description: Credit Note APIs
paths:
  /external/customer/{buyer_id}:
    parameters:
      - name: buyer_id
        in: path
        required: true
        schema:
          type: string
    post:
      tags:
        - external
      summary: Update customer with its tags, internal stakeholders and contacts
      operationId: post_customer_update_route
      parameters:
        - name: X-Valyx-Signature
          in: header
          required: true
          schema:
            type: string
          description: Auth key for creating customers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateExternalCustomer'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties: {}
components:
  schemas:
    UpdateExternalCustomer:
      properties:
        customer:
          $ref: '#/components/schemas/UpdateExternalCustomerModel'
      type: object
    UpdateExternalCustomerModel:
      properties:
        name:
          type: string
          description: name
        alias:
          type: string
          description: alias
        registeredAddress:
          $ref: '#/components/schemas/UpdateExternalCustomerModelregisteredAddress'
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/UpdateExternalCustomerModeladdresses'
        contactsData:
          $ref: '#/components/schemas/UpdateExternalCustomerQueryModelcontactsData'
        internalStakeholdersData:
          $ref: >-
            #/components/schemas/UpdateExternalCustomerQueryModelinternalStakeholdersData
        stateCode:
          type: string
          description: stateCode
        countryCode:
          type: string
          description: countryCode
          default: IN
        country:
          type: string
          description: country
        primaryPhone:
          type: string
          description: primaryPhone
        primaryEmail:
          type: string
          description: primaryEmail
        customerContactPerson:
          type: string
          description: customerContactPerson
        currency:
          type: string
          description: currency
          default: INR
        currencyId:
          type: string
          description: currencyId
        tags:
          type: object
        metaData:
          type: object
        customerStatus:
          type: string
          example: PROSPECT
          enum:
            - PROSPECT
            - LIVE
            - CHURNED
            - INACTIVE
        upcomingCustomerStatus:
          type: string
          example: PROSPECT
          enum:
            - PROSPECT
            - LIVE
            - CHURNED
            - INACTIVE
        upcomingCustomerStatusChangeDate:
          type: string
          format: date
          description: upcomingCustomerStatusChangeDate
        upcomingCustomerStatusChangeReason:
          type: string
          description: upcomingCustomerStatusChangeReason
        upcomingCustomerStatusChangeByUserid:
          type: string
          description: upcomingCustomerStatusChangeByUserid
      type: object
    UpdateExternalCustomerModelregisteredAddress:
      properties:
        line1:
          type: string
          description: line1
        line2:
          type: string
          description: line2
        state:
          type: string
          description: state
        city:
          type: string
          description: city
        country:
          type: string
          description: country
        zipCode:
          type: string
          description: zipCode
      type: object
    UpdateExternalCustomerModeladdresses:
      properties:
        line1:
          type: string
          description: line1
        line2:
          type: string
          description: line2
        state:
          type: string
          description: state
        city:
          type: string
          description: city
        country:
          type: string
          description: country
        zipCode:
          type: string
          description: zipCode
      type: object
    UpdateExternalCustomerQueryModelcontactsData:
      properties:
        add:
          type: array
          items:
            $ref: >-
              #/components/schemas/UpdateExternalCustomerQueryModelcontactsDataAdd
        update:
          type: array
          items:
            $ref: >-
              #/components/schemas/UpdateExternalCustomerQueryModelcontactsDataUpdate
        delete:
          type: array
          items:
            $ref: >-
              #/components/schemas/UpdateExternalCustomerQueryModelcontactsDataDelete
      type: object
    UpdateExternalCustomerQueryModelinternalStakeholdersData:
      properties:
        add:
          type: array
          items:
            $ref: >-
              #/components/schemas/UpdateExternalCustomerQueryModelinternalStakeholdersDataAdd
        update:
          type: array
          items:
            $ref: >-
              #/components/schemas/UpdateExternalCustomerQueryModelinternalStakeholdersDataUpdate
        delete:
          type: array
          items:
            $ref: >-
              #/components/schemas/UpdateExternalCustomerQueryModelinternalStakeholdersDataDelete
      type: object
    UpdateExternalCustomerQueryModelcontactsDataAdd:
      required:
        - name
        - primaryEmail
        - primaryPhone
        - role
      properties:
        name:
          type: string
          description: name
        primaryPhone:
          type: string
          description: primaryPhone
        primaryEmail:
          type: string
          description: primaryEmail
        role:
          type: string
          description: role
      type: object
    UpdateExternalCustomerQueryModelcontactsDataUpdate:
      required:
        - id
      properties:
        id:
          type: string
          description: id
        name:
          type: string
          description: name
        role:
          type: string
          description: role
        primaryPhone:
          type: string
          description: primaryPhone
        primaryEmail:
          type: string
          description: primaryEmail
      type: object
    UpdateExternalCustomerQueryModelcontactsDataDelete:
      properties:
        name:
          type: string
          description: name
        role:
          type: string
          description: role
      type: object
    UpdateExternalCustomerQueryModelinternalStakeholdersDataAdd:
      required:
        - name
        - primaryEmail
        - role
      properties:
        name:
          type: string
          description: name
        primaryEmail:
          type: string
          description: primaryEmail
        role:
          type: string
          description: role
        primaryPhone:
          type: string
          description: primaryPhone
      type: object
    UpdateExternalCustomerQueryModelinternalStakeholdersDataUpdate:
      required:
        - name
        - primaryEmail
        - role
      properties:
        name:
          type: string
          description: name
        primaryEmail:
          type: string
          description: primaryEmail
        role:
          type: string
          description: role
        primaryPhone:
          type: string
          description: primaryPhone
      type: object
    UpdateExternalCustomerQueryModelinternalStakeholdersDataDelete:
      properties:
        name:
          type: string
          description: name
        role:
          type: string
          description: role
      type: object

````