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

# Update a customer



## OpenAPI

````yaml https://api.timbrix.mx/api/openapi.json put /customers/{customerId}
openapi: 3.0.0
info:
  title: Timbrix API
  description: >-
    API de facturación electrónica CFDI 4.0 para México, con servidor OAuth2
    para gestionar organizaciones, miembros y webhooks. Compatible con agentes
    de IA — ver la extensión `x-ai-agent-friendly` en la raíz de esta spec.


    REST API with OAuth2 server for managing organizations, members, and
    webhooks.
  version: '1.0'
  contact: {}
servers: []
security: []
tags:
  - name: organizations
    description: Organization management endpoints
  - name: oauth
    description: OAuth2 authentication and authorization
  - name: webhooks
    description: Webhook configuration and delivery
  - name: users
    description: User information endpoints
  - name: api-keys
    description: API Keys management and validation
paths:
  /customers/{customerId}:
    put:
      tags:
        - customers
      summary: Update a customer
      operationId: CustomersController_update
      parameters:
        - name: X-Organization-Id
          in: header
          description: >-
            Required for Supabase session auth. Ignored when authenticating with
            an API key (the organization resolves from the key).
          required: false
          schema:
            type: string
        - name: customerId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCustomerDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponseDto'
        '400':
          description: Missing X-Organization-Id header for a session request
      security:
        - apiKey: []
        - bearer: []
components:
  schemas:
    UpdateCustomerDto:
      type: object
      properties:
        legalName:
          type: string
          description: Customer legal name
          example: Dunder Mifflin
        taxId:
          type: string
          description: Mexican RFC
          example: ABC101010111
        taxSystem:
          type: string
          description: SAT tax system code
          example: '601'
        email:
          type: string
          description: Customer email
          example: email@example.com
        phone:
          type: string
          description: Customer phone
          example: '6474010101'
        defaultInvoiceUse:
          type: string
          description: Default CFDI use code
          example: G01
        addressStreet:
          type: string
          description: Street name
        addressExterior:
          type: string
          description: Exterior number
        addressInterior:
          type: string
          description: Interior number
        addressNeighborhood:
          type: string
          description: Neighborhood
        addressCity:
          type: string
          description: City
        addressMunicipality:
          type: string
          description: Municipality
        addressZip:
          type: string
          description: ZIP code
        addressState:
          type: string
          description: State
        addressCountry:
          type: string
          description: Country code
    CustomerResponseDto:
      type: object
      properties:
        id:
          type: string
          example: 590ce6c56d04f840aa8438af
        organizationId:
          type: string
          example: org-uuid
        legalName:
          type: string
          example: Dunder Mifflin
        taxId:
          type: string
          example: ABC101010111
        taxSystem:
          type: string
          example: '601'
        email:
          type: string
          example: email@example.com
        phone:
          type: object
          example: '6474010101'
        defaultInvoiceUse:
          type: string
          example: G01
        address:
          $ref: '#/components/schemas/CustomerAddressDto'
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
      required:
        - id
        - organizationId
        - legalName
        - taxId
        - taxSystem
        - email
        - defaultInvoiceUse
        - address
        - createdAt
        - updatedAt
    CustomerAddressDto:
      type: object
      properties:
        street:
          type: string
          example: Blvd. Atardecer
        exterior:
          type: string
          example: '142'
        interior:
          type: object
          example: '4'
        neighborhood:
          type: string
          example: Centro
        city:
          type: string
          example: Huatabampo
        municipality:
          type: string
          example: Huatabampo
        zip:
          type: string
          example: '86500'
        state:
          type: string
          example: Sonora
        country:
          type: string
          example: MEX
      required:
        - street
        - exterior
        - neighborhood
        - city
        - municipality
        - zip
        - state
        - country
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API Key for authentication (format: sk_...)'
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````