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

# Update a customer

> This API let’s you to update a customer’s information using customer_id.



## OpenAPI

````yaml patch /customers/{customer_id}
openapi: 3.0.3
info:
  version: '1.0'
  title: Togai Apis
  contact:
    email: engg@togai.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  description: APIs for Togai App
servers:
  - description: Api endpoint
    url: https://api.togai.com/
  - description: Sandbox api endpoint
    url: https://sandbox-api.togai.com/
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: Customer level calls
  - name: Accounts
    description: Account level calls
  - name: Event Schemas
    description: Event Schema level calls
  - name: Usage Meters
    description: Usage Meter level calls
  - name: Price Plans
    description: (DEPRECATED) Price Plan level calls
  - name: PricePlanV2
    description: Price Plan V2 level calls
  - name: Schedules
    description: Account Schedule level calls
  - name: Pricing Rules
    description: Pricing Rules level calls
  - name: Settings
    description: Settings
  - name: Price Experimentation
    description: Price Experimentation apis
  - name: InvoiceGroups
    description: Invoice Group level calls
  - name: Organization
    description: Organization level calls
  - name: FileStorage
    description: File Storage level calls
  - name: Aliases
    description: Alias level calls
  - name: Reports
    description: Report level calls
  - name: ReportTemplates
    description: Report Template level calls
  - name: Customer Portal
    description: Portal level calls
  - name: Alerts
    description: Alert level calls
  - name: Event Management
    description: APIs for getting events ingested in Togai
    externalDocs:
      description: docs
      url: https://togai.com/docs/billing/events
  - name: Metrics
    description: APIs for getting Togai metrics
    externalDocs:
      description: docs
      url: https://togai.com/docs/metrics
  - name: Licenses
    description: APIs for getting or updating license records in Togai
  - name: Entitlements
    description: APIs related to entitlements
  - name: Invoices
    description: Invoices API
  - name: Credits
    description: Credits API
  - name: Wallet
    description: Wallet API
  - name: InvoiceTemplates
    description: InvoiceTemplates API
  - name: InvoiceSequence
    description: InvoiceSequence API
  - name: Payments
    description: Payments API
  - name: Authentication
    description: Authentication API
externalDocs:
  description: Find out more about Togai
  url: https://docs.togai.com/docs
paths:
  /customers/{customer_id}:
    patch:
      tags:
        - Customers
      summary: Update a customer
      description: This API let’s you to update a customer’s information using customer_id.
      operationId: updateCustomer
      parameters:
        - $ref: '#/components/parameters/customer_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateCustomerRequest'
      responses:
        '200':
          $ref: '#/components/responses/CustomerResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    customer_id:
      in: path
      name: customer_id
      required: true
      schema:
        type: string
        maxLength: 50
        example: 01BX5ZZKBKACTAV9WEVGEMMVRZ
  requestBodies:
    UpdateCustomerRequest:
      description: Payload to update customer
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateCustomerRequest'
          examples:
            UpdateCustomerRequest:
              $ref: '#/components/examples/UpdateCustomerRequest'
  responses:
    CustomerResponse:
      description: Response for Get customer requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Customer'
          examples:
            Customer:
              $ref: '#/components/examples/Customer'
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            ErrorResponse:
              summary: Error message
              value:
                message: <Reason message>
  schemas:
    UpdateCustomerRequest:
      description: Payload to update customer
      type: object
      additionalProperties: false
      properties:
        name:
          description: Name of the Customer
          type: string
          maxLength: 255
          minLength: 3
          example: ACME Enterprise
        primaryEmail:
          description: Primary email of the customer
          type: string
          maxLength: 320
          example: admin@example.com
        address:
          $ref: '#/components/schemas/Address'
    Customer:
      description: Structure of customer
      type: object
      additionalProperties: false
      required:
        - name
        - id
        - togaiCustomerId
        - primaryEmail
        - billingAddress
        - address
        - status
        - createdAt
        - updatedAt
      properties:
        id:
          description: Identifier of customer
          type: string
          maxLength: 50
        togaiCustomerId:
          description: Unique identifier of customer
          type: string
        name:
          description: Name of the Customer
          type: string
          maxLength: 255
          minLength: 3
        primaryEmail:
          description: Primary email of the customer
          type: string
          maxLength: 320
        billingAddress:
          description: billing address of the customer
          type: string
          maxLength: 1000
          example: 201 Boulevard, WA 53123
        address:
          $ref: '#/components/schemas/Address'
        status:
          description: Status of the customer
          type: string
          enum:
            - ACTIVE
            - ARCHIVED
          example: ACTIVE
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - message
      properties:
        message:
          type: string
          description: error description
          maxLength: 500
    Address:
      description: billing address of the customer
      type: object
      additionalProperties: false
      properties:
        phoneNumber:
          description: Contact number
          type: string
        line1:
          description: Address line 1 (eg. Street, PO Box, Company Name)
          type: string
        line2:
          description: Address line 2 (eg. apartment, suite, unit or building)
          type: string
        postalCode:
          description: ZIP or postal code
          type: string
        city:
          description: City, district, suburb, town or village
          type: string
        state:
          description: State, county, province or region
          type: string
        country:
          description: >-
            Two letter country code [ISO-3166-1
            Alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
          type: string
  examples:
    UpdateCustomerRequest:
      value:
        name: ACME Enterprise
        primaryEmail: admin@example.com
        address:
          phoneNumber: '+919876543210'
          line1: 2281 Broadway Street
          line2: G-31
          postalCode: '29501'
          city: Florence
          state: South Carolina
          country: US
    Customer:
      summary: A sample Customer
      value:
        id: 01BX5ZZKBKACTAV9WEVGEMMVRZ
        togaiCustomerId: customer.dsvvre314.dcs14
        name: ACME Enterprise
        primaryEmail: admin@example.com
        address:
          phoneNumber: '+919876543210'
          line1: 2281 Broadway Street
          line2: G-31
          postalCode: '29501'
          city: Florence
          state: South Carolina
          country: US
        billingAddress: 2281 Broadway Street, G-31, 29501, Florence, South Carolina, US
        status: ACTIVE
        updatedAt: '2020-07-04T12:00:00.000Z'
        createdAt: '2020-07-04T12:00:00.000Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Bearer <credential>

````