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

# Update customer

> Updates editable fields of an existing customer by id.



## OpenAPI

````yaml /openapi.yaml patch /v1/customers/{id}
openapi: 3.0.3
info:
  title: Quentli REST API
  version: 1.0.0
  description: OpenAPI spec for Quentli REST endpoints.
servers:
  - url: https://api.quentli.com
    description: Production API
  - url: https://api.staging.quentli.com
    description: Staging API for production-like validation
  - url: https://api.demo.quentli.com
    description: Demo API hostname served by staging
security:
  - organizationApiKey: []
tags:
  - name: Auth
  - name: Billing
  - name: Catalog
  - name: Customers
  - name: Invoices
  - name: Payment Methods
  - name: Payment Sessions
  - name: Payments
  - name: Subscriptions
  - name: Tax Invoices
  - name: Webhooks
paths:
  /v1/customers/{id}:
    patch:
      tags:
        - Customers
      summary: Update customer
      description: Updates editable fields of an existing customer by id.
      operationId: customers_update
      parameters:
        - schema:
            type: string
            description: Identifier of the customer.
          required: true
          description: Identifier of the customer.
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCustomerArgs'
      responses:
        '200':
          description: Customer updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateCustomerPayload'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '403':
          description: Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
        '404':
          description: Customer not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserError'
components:
  schemas:
    UpdateCustomerArgs:
      type: object
      properties:
        input:
          $ref: '#/components/schemas/UpdateCustomerInput'
      required:
        - input
      description: Request body for updating a customer.
    UpdateCustomerPayload:
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/Customer'
      required:
        - customer
      description: Successful customer update response.
    UserError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
          required:
            - message
      required:
        - error
      additionalProperties: false
      description: Standard user-facing error response envelope.
    UpdateCustomerInput:
      type: object
      properties:
        otp:
          type: string
          description: Verification code required for sensitive changes.
          example: '123456'
        data:
          $ref: '#/components/schemas/UpdateCustomerDataInput'
      required:
        - data
      description: Client payload used to update a customer.
    Customer:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the customer.
          example: cus_1234567890abcdefghij
        createdAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
          description: Date and time when the customer was created.
          example: '2025-01-10T12:00:00.000Z'
        updatedAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
          description: Date and time when the customer was last updated.
          example: '2025-01-10T12:00:00.000Z'
        name:
          type: string
          description: Name of the customer.
          example: Juan Pérez
        username:
          type: string
          description: Username used for customer login and customer identification.
          example: juan_perez_01
        email:
          type: string
          nullable: true
          description: Email address of the customer.
          example: juan@example.com
        phoneNumber:
          type: string
          nullable: true
          description: >-
            Primary WhatsApp phone number of the customer, usually in E.164
            format.
          example: '+525512345678'
        organizationId:
          type: string
          description: Identifier of the organization this customer belongs to.
          example: org_1234567890abcdefghij
        secondaryPhoneNumber:
          type: string
          nullable: true
          description: Secondary phone number used for reminders and announcements.
          example: null
        archivedAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: Date and time when the customer was archived.
          example: null
        archivedById:
          type: string
          nullable: true
          description: Identifier of the user who archived this customer.
          example: u_1234567890abcdefghij
        acceptedServiceAgreement:
          type: boolean
          description: Whether the customer has accepted the service agreement.
          example: true
        skipTaxInvoice:
          type: boolean
          description: Whether tax invoice generation is skipped for this customer.
          example: false
        emailVerified:
          type: boolean
          description: Whether the customer has verified their email address.
          example: false
        phoneNumberVerified:
          type: boolean
          description: Whether the customer has verified their phone number.
          example: true
        hasChangedPassword:
          type: boolean
          description: Whether the customer has set a non-default password.
          example: true
        signatureAcceptedAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: >-
            Date and time when recurring charges terms were accepted via
            signature.
          example: '2025-01-10T12:00:00.000Z'
        optedOutWhatsappAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: Date and time when the customer opted out of WhatsApp reminders.
          example: null
        optedInWhatsappAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: Date and time when the customer opted in to WhatsApp reminders.
          example: '2025-01-05T10:00:00.000Z'
        startedWhatsappAt:
          anyOf:
            - type: string
              description: Date string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: >-
            Date and time when WhatsApp opt-in flow was started for this
            customer.
          example: '2025-01-05T09:55:00.000Z'
        replyWithAssistant:
          type: boolean
          nullable: true
          description: Whether to reply to this customer using the assistant.
          example: false
        metadata:
          type: array
          nullable: true
          items:
            type: object
            properties:
              key:
                type: string
              value:
                type: string
            required:
              - key
              - value
            additionalProperties: false
          description: >-
            Custom metadata entries attached to this customer as key-value
            pairs.
          example:
            - key: studentId
              value: A-1029
        meta:
          type: object
          nullable: true
          additionalProperties:
            type: string
          description: Flattened metadata map where each key maps to a string value.
          example:
            studentId: A-1029
      required:
        - id
        - createdAt
        - updatedAt
        - name
        - username
        - organizationId
        - acceptedServiceAgreement
        - skipTaxInvoice
        - emailVerified
        - phoneNumberVerified
        - hasChangedPassword
      description: >-
        Customer record including identity, contact details, and messaging
        preferences.
    UpdateCustomerDataInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          description: Updated customer name.
          example: Juan Perez
        email:
          type: string
          nullable: true
          format: email
          description: Updated email address.
          example: juan@example.com
        phoneNumber:
          type: string
          nullable: true
          description: Updated primary WhatsApp phone number (E.164).
          example: '+525512345678'
        password:
          type: string
          description: New customer password.
          example: S3curePassw0rd!
        username:
          type: string
          minLength: 1
          description: Updated username.
          example: juan_perez_01
        tags:
          type: array
          items:
            type: string
          description: Updated tag list.
          example:
            - VIP
            - Colegiatura
        tosIp:
          type: string
          description: IP captured when terms are accepted.
          example: 189.203.12.45
        secondaryPhoneNumber:
          type: string
          nullable: true
          description: Updated secondary phone number (E.164).
          example: '+525598765432'
        acceptedServiceAgreement:
          type: boolean
          description: Whether service agreement is accepted.
          example: true
        skipTaxInvoice:
          type: boolean
          description: Whether to skip tax invoices.
          example: false
        signature:
          type: string
          nullable: true
          description: Base64 or URL signature payload.
          example: signed-by-customer
        assigneeId:
          type: string
          nullable: true
          description: Member id assigned to this customer.
          example: cmab12cd3000x1a2b3c4d5e6f
        optedOutWhatsappAt:
          anyOf:
            - type: string
              format: date-time
              description: ISO date-time string
            - type: string
              format: date-time
              description: Date object
            - nullable: true
          description: Date and time when customer opted out from WhatsApp.
          example: '2025-01-15T10:30:00.000Z'
        hasChangedPassword:
          type: boolean
          description: Flag indicating password was changed.
          example: true
        phoneNumberVerified:
          type: boolean
          description: Whether phone number is verified.
          example: true
        emailVerified:
          type: boolean
          description: Whether email is verified.
          example: true
        replyWithAssistant:
          type: boolean
          nullable: true
          description: Whether assistant replies are enabled for this customer.
          example: false
        metadata:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                minLength: 1
                description: Metadata key name.
                example: studentId
              value:
                type: string
                nullable: true
                description: Metadata value.
                example: A-1029
            required:
              - key
          description: Metadata entries to upsert. Null values delete keys.
          example:
            - key: studentId
              value: A-1029
        meta:
          type: object
          additionalProperties:
            type: string
            nullable: true
          description: Flat metadata map. Null/empty values remove keys.
          example:
            grade: 5A
      description: Fields that can be updated on a customer.
  securitySchemes:
    organizationApiKey:
      type: http
      scheme: bearer
      description: 'Organization API key using `Authorization: Bearer sk_...`.'

````