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

# Update Customer

> Update a Customer by id.



## OpenAPI

````yaml put /customers/{customerId}
openapi: 3.0.0
info:
  title: Vayu API
  version: 1.0.0
  description: >-
    The Vayu API is a RESTful API that allows you to submit events for
    processing and storage & manage billing related entities.
              The API is secured using the Bearer Authentication scheme with JWT tokens.
              To obtain a JWT token, please contact Vayu at team@withvayu.com
  contact:
    email: dev@withvayu.com
    name: Vayu, Inc
    url: https://withvayu.com
servers:
  - url: https://connect.withvayu.com
    description: Production server
  - url: https://staging-connect.withvayu.com
    description: Sandbox server
security: []
tags:
  - name: auth
    description: >-
      The auth tag is used for endpoints related to authentication and
      authorization.
  - name: events
    description: The events tag is used for endpoints related to event ingestion.
  - name: customers
    description: The customers tag is used for endpoints related to customer management.
  - name: meters
    description: The meters tag is used for endpoints related to meter management.
  - name: contracts
    description: The contracts tag is used for endpoints related to contract management.
  - name: invoices
    description: The invoices tag is used for endpoints related to invoice management.
  - name: credits
    description: The credits tag is used for endpoints related to credit management.
  - name: webhooks
    description: The webhooks tag is used for endpoints related to webhook management.
paths:
  /customers/{customerId}:
    put:
      tags:
        - customers
      summary: Update Customer
      description: Update a Customer by id.
      operationId: updateCustomer
      parameters:
        - schema:
            $ref: '#/components/schemas/CustomerId'
          required: true
          in: path
          name: customerId
      requestBody:
        $ref: '#/components/requestBodies/UpdateCustomerRequest'
      responses:
        '200':
          $ref: '#/components/responses/UpdateCustomerResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      security:
        - BearerAuthorizer: []
components:
  schemas:
    CustomerId:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
    ValidationErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
        code:
          type: string
          description: Specific machine-readable error code
        message:
          type: string
          description: Human-readable error explanation
        param:
          type: string
          description: Single parameter that failed validation
        params:
          type: array
          items:
            type: object
            properties:
              param:
                type: string
                description: The parameter that failed validation
              message:
                type: string
                description: Why validation failed for this parameter
            required:
              - param
              - message
          description: Multiple parameters that failed validation
      required:
        - type
        - code
        - message
    UnauthorizedErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - authentication_error
        code:
          type: string
          enum:
            - authentication_failed
        message:
          type: string
          description: Human-readable error explanation
      required:
        - type
        - code
        - message
    NotFoundErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - invalid_request_error
        code:
          type: string
          enum:
            - resource_not_found
        message:
          type: string
          description: Human-readable error explanation
      required:
        - type
        - code
        - message
    RateLimitErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - rate_limit_error
        code:
          type: string
          enum:
            - rate_limit_exceeded
        message:
          type: string
          description: Human-readable error explanation
      required:
        - type
        - code
        - message
    InternalServerErrorResponse:
      type: object
      properties:
        type:
          type: string
          enum:
            - api_error
        code:
          type: string
          enum:
            - internal_error
        message:
          type: string
          description: Human-readable error explanation
      required:
        - type
        - code
        - message
    UpdateCustomerRequest:
      type: object
      properties:
        name:
          type: string
          description: The name of the customer
        aliases:
          type: array
          nullable: true
          items:
            type: string
          default: []
          description: The aliases of the customer used to match events to the customer.
        contacts:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/Contact'
          description: >-
            The contacts of the customer. Contact marked as primary is the
            target for invoice sharing.
        source:
          $ref: '#/components/schemas/CustomerSource'
        legalName:
          type: string
          nullable: true
          description: The legal name of the customer
        taxIds:
          type: array
          nullable: true
          items:
            type: string
          default: []
          description: The tax IDs of the customer
        taxId:
          type: string
          nullable: true
          description: The tax ID of the customer (deprecated, use taxIds instead)
          deprecated: true
        cloudProviderSettings:
          $ref: '#/components/schemas/CustomerCloudProviderSettings'
        externalId:
          type: string
          description: The external ID of the customer
        customerErpId:
          type: string
          nullable: true
          description: The ID of the customer in the ERP system
        address:
          $ref: '#/components/schemas/Address'
        salesForceAccountId:
          type: string
          nullable: true
          description: The ID of the customer in the Salesforce system
        dueDays:
          type: string
          nullable: true
          enum:
            - END_OF_MONTH
            - SAME_DAY
            - 15_DAYS
            - 30_DAYS
            - 45_DAYS
            - 60_DAYS
            - 90_DAYS
          description: The due days of the customer
        currency:
          $ref: '#/components/schemas/Currency'
        customFields:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/CustomField'
          description: Custom fields from CRM systems (Salesforce, HubSpot, etc.)
        subsidiary:
          type: string
          nullable: true
          description: The name of the subsidiary of the customer
        totalOutstandingAmount:
          type: number
          description: Total outstanding amount across all unpaid invoices (in USD)
        openAmount:
          type: number
          description: Total amount of invoices with no billing status set (in USD)
        overdueAmount:
          type: number
          description: Total amount of overdue invoices (in USD)
        pendingPaymentAmount:
          type: number
          description: Total amount of invoices pending payment (in USD)
        paidAmount:
          type: number
          description: Total amount of paid invoices (in USD)
      additionalProperties: false
    UpdateCustomerResponse:
      type: object
      properties:
        customer:
          type: object
          properties:
            name:
              type: string
              description: The name of the customer
            aliases:
              type: array
              nullable: true
              items:
                type: string
              default: []
              description: >-
                The aliases of the customer used to match events to the
                customer.
            contacts:
              type: array
              nullable: true
              items:
                $ref: '#/components/schemas/Contact'
              description: >-
                The contacts of the customer. Contact marked as primary is the
                target for invoice sharing.
            source:
              $ref: '#/components/schemas/CustomerSource'
            legalName:
              type: string
              nullable: true
              description: The legal name of the customer
            taxIds:
              type: array
              nullable: true
              items:
                type: string
              default: []
              description: The tax IDs of the customer
            taxId:
              type: string
              nullable: true
              description: The tax ID of the customer (deprecated, use taxIds instead)
              deprecated: true
            cloudProviderSettings:
              $ref: '#/components/schemas/CustomerCloudProviderSettings'
            externalId:
              type: string
              description: The external ID of the customer
            customerErpId:
              type: string
              nullable: true
              description: The ID of the customer in the ERP system
            address:
              $ref: '#/components/schemas/Address'
            salesForceAccountId:
              type: string
              nullable: true
              description: The ID of the customer in the Salesforce system
            dueDays:
              type: string
              nullable: true
              enum:
                - END_OF_MONTH
                - SAME_DAY
                - 15_DAYS
                - 30_DAYS
                - 45_DAYS
                - 60_DAYS
                - 90_DAYS
              description: The due days of the customer
            currency:
              $ref: '#/components/schemas/Currency'
            customFields:
              type: array
              nullable: true
              items:
                $ref: '#/components/schemas/CustomField'
              description: Custom fields from CRM systems (Salesforce, HubSpot, etc.)
            subsidiary:
              type: string
              nullable: true
              description: The name of the subsidiary of the customer
            totalOutstandingAmount:
              type: number
              description: Total outstanding amount across all unpaid invoices (in USD)
            openAmount:
              type: number
              description: Total amount of invoices with no billing status set (in USD)
            overdueAmount:
              type: number
              description: Total amount of overdue invoices (in USD)
            pendingPaymentAmount:
              type: number
              description: Total amount of invoices pending payment (in USD)
            paidAmount:
              type: number
              description: Total amount of paid invoices (in USD)
            id:
              type: string
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
          required:
            - name
            - id
            - createdAt
            - updatedAt
      required:
        - customer
    Contact:
      type: object
      properties:
        name:
          type: string
        email:
          type: string
          pattern: >-
            ^(?!\.)[A-Za-z0-9_!#$%&'*+/=?^`{|}~-]+(?:\.[A-Za-z0-9_!#$%&'*+/=?^`{|}~-]+)*@([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z]{2,}$
        title:
          type: string
        phone:
          type: string
          pattern: ^\+?[1-9]\d{4,15}$
        receiveInvoiceEmail:
          type: boolean
    CustomerSource:
      type: string
      nullable: true
      enum:
        - Stripe
        - VayuEventsApi
        - Api
        - Salesforce
        - HubSpot
      description: The source of the customer
    CustomerCloudProviderSettings:
      type: object
      nullable: true
      properties:
        cloudProvider:
          type: string
          enum:
            - AWS
        cloudProviderMarketplaceId:
          type: string
        customerIdentifier:
          type: string
      description: Cloud provider settings for the customer
    Address:
      type: object
      nullable: true
      properties:
        country:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        addressText:
          type: string
          nullable: true
        state:
          type: string
          nullable: true
        postalCode:
          type: string
          nullable: true
      description: The address of the customer
    Currency:
      type: string
      nullable: true
      enum:
        - USD
        - EUR
        - GBP
        - ILS
        - CAD
        - AUD
        - COP
        - BRL
      description: The billing currency of the customer
    CustomField:
      type: object
      properties:
        integrationSource:
          type: string
          enum:
            - NetSuite
            - QuickBooks
            - Stripe
            - Salesforce
            - Hubspot
            - Vayu
            - Slack
            - S3
            - Morning
            - Snowflake
            - Anrok
            - Connact
            - Xero
          description: The integration provider (e.g., "Salesforce", "HubSpot")
        integrationEntityType:
          $ref: '#/components/schemas/IntegrationEntityTypes'
        fieldPath:
          type: string
          description: The path to the field in the integration (e.g., "root.path.field")
        vayuCustomFieldName:
          type: string
          description: The name of the field in Vayu (e.g., "AE Name")
        valueType:
          $ref: '#/components/schemas/CustomFieldValueTypes'
        value:
          nullable: true
          description: The actual value of the custom field
      required:
        - vayuCustomFieldName
        - valueType
    IntegrationEntityTypes:
      type: string
      enum:
        - Account
        - Invoice
        - SalesOrder
        - Item
        - Deal
        - Company
        - Opportunity
      description: The entity type in the integration (e.g., "Opportunity", "Deal")
    CustomFieldValueTypes:
      type: string
      enum:
        - String
        - Number
        - Boolean
      description: 'The type of the value: "String", "Number", or "Boolean"'
  requestBodies:
    UpdateCustomerRequest:
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateCustomerRequest'
  responses:
    UpdateCustomerResponse:
      description: RequestSuccess
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateCustomerResponse'
  securitySchemes:
    BearerAuthorizer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````