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

# Update customer

> Update a customer, including their addresses and exemption certificates.

Updates an existing customer's information.

## Path parameters

<ParamField path="id" type="string" required>
  The unique identifier for the customer
</ParamField>

## Request body

<ParamField body="name" type="string">
  Customer name (minimum 3 characters)
</ParamField>

<ParamField body="email" type="string">
  Customer email address (must be valid email format)
</ParamField>

<ParamField body="business_identification_number" type="string">
  A tax or business registration number for the customer (e.g., VAT ID, EIN, GST number).
</ParamField>

<ParamField body="shipping_address" type="object">
  Customer's shipping address

  <Expandable title="shipping_address properties">
    <ParamField body="line1" type="string">
      Street address line 1
    </ParamField>

    <ParamField body="line2" type="string">
      Street address line 2
    </ParamField>

    <ParamField body="city" type="string">
      City name
    </ParamField>

    <ParamField body="state" type="string">
      State or province code
    </ParamField>

    <ParamField body="postal_code" type="string">
      Postal or ZIP code
    </ParamField>

    <ParamField body="country" type="string">
      ISO 3166 2-letter country code
    </ParamField>
  </Expandable>
</ParamField>

## Response

Returns a success message upon successful update.

<RequestExample>
  ```json theme={null}
  {
    "name": "Acme Corporation Updated",
    "email": "newemail@acme.com",
    "business_identification_number": "12-3456789",
    "shipping_address": {
      "line1": "456 New St",
      "line2": "Floor 2",
      "city": "Los Angeles",
      "state": "CA",
      "postal_code": "90001",
      "country": "US"
    }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "message": "Customer updated successfully"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /customers/{id}
openapi: 3.0.1
info:
  title: Commenda Public APIs
  description: >-
    APIs for Commenda entity management, partner incorporation, indirect tax,
    compliance, and corporate operations.
  license:
    name: NONE
    url: NONE
  version: 1.0.0
servers:
  - url: https://api.prod.commenda.io/api/v1
    description: Commenda platform APIs, including Partner Incorporation and Commenda OS.
  - url: https://transaction-tax.api.in.commenda.io/api/v1
    description: Global Indirect Tax API.
security:
  - bearerAuth: []
paths:
  /customers/{id}:
    post:
      summary: Update a customer
      description: Update a customer, including their addresses and exemption certificates.
      operationId: updateCustomer
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: The unique identifier of the transaction to update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerUpdate'
      responses:
        '200':
          description: Information about the customer after the update
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Successfully updated customer.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CustomerUpdate:
      type: object
      properties:
        name:
          type: string
          description: A display name for this customer.
          minLength: 3
        email:
          type: string
          description: Email address of the customer.
          format: email
        shipping_address:
          $ref: '#/components/schemas/Address'
        business_identification_number:
          type: string
          description: >-
            Business identification number for the customer (e.g., tax ID, VAT
            number, or EIN).
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              description: 'Specific Error type. Example: CLIENT_INVALID_REQUEST_BODY.'
              example: CLIENT_INVALID_REQUEST_BODY
            doc_url:
              type: string
              description: >-
                A link to the docs with details about this error. Example:
                https://sales-tax-docs.commenda.io/
              example: https://sales-tax-docs.commenda.io/
            title:
              type: string
              description: >-
                A short title describing the error. Example: Missing query
                parameters.
              example: Failed to validate the request body
            detail:
              type: string
              description: >-
                A json string with a description on how to fix the error.
                Example {"description":"Please pass in a valid corporation_id"}
            status:
              type: number
              description: >-
                The status code. It should be the same as the HTTP protocol
                status code. Example: 200
              example: 400
            instance:
              type: string
              description: >-
                The relative path that was hit by the user. Example:
                /api/v1/corporations/1
            Errors:
              type: array
              items:
                type: object
                properties:
                  details:
                    type: string
                    description: More details on how to solve this particular error.
                  pointer:
                    type: string
                    description: >-
                      Relative reference to missing or invalid piece of passed
                      information.
    Address:
      type: object
      required:
        - country
      description: >
        Address object. Only `country` is required at the schema level. All
        other field requirements (including `postal_code` and `state`) vary by
        country — use the `/address-requirements` endpoint to check which fields
        are REQUIRED, OPTIONAL, or IGNORED for a given country. When provided,
        postal codes and state codes are validated against country-specific
        formats and allowed values.
      properties:
        address_line_1:
          type: string
          example: 1776 Main St
          description: Primary street address. Required for some countries (e.g., US).
        address_line_2:
          type: string
          example: 'Apt. #123'
          description: >-
            Secondary address line (apartment, suite, etc.). Optional for most
            countries.
        address_line_3:
          type: string
          description: Tertiary address line. Ignored for most countries.
        postal_code:
          type: string
          description: >
            Postal or ZIP code. Required for many countries (e.g., US, GB, DE,
            FR) and optional for others (e.g., CA). Format varies by country.
            For US addresses, either 5-digit ZIP or 9-digit ZIP+4 is accepted.
            Use the `/address-requirements` endpoint to check whether this field
            is required and to get the validation regex for each country.
          example: '90401'
        city:
          type: string
          example: Santa Monica
          description: City name. Required for some countries (e.g., US).
        state:
          $ref: '#/components/schemas/State'
          description: >
            State or province code. Required for some countries (e.g., US) and
            optional for others (e.g., GB, DE). Must be a valid ISO 3166-2
            subdivision code for the given country when provided. Use the
            `/address-requirements` endpoint to check whether this field is
            required and to get the list of valid state codes for each country.
        country:
          $ref: '#/components/schemas/Country'
    State:
      type: string
      example: CA
      description: >-
        2-letter code for each state. Suffix of the ISO 3166-2 code. Ex: CA, NY,
        TX.
    Country:
      type: string
      example: US
      description: 'ISO 3166 2-letter country code. Ex: US, IN, GB.'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````