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

# Update a customer.



## OpenAPI

````yaml /openapi/ledgerup-engine.json patch /v2/customers/{customer_id}
openapi: 3.1.0
info:
  title: LedgerUp API
  version: 0.1.0
  description: OpenAPI contract for the LedgerUp API.
servers: []
security: []
tags:
  - name: Health
  - name: Customers
  - name: Accounts
  - name: Grants
  - name: Currencies
    description: Currencies discovered from reported usage events.
  - name: Metrics
  - name: Refill Configurations
    description: Automatic balance refill thresholds and targets for an account and metric.
  - name: Events
    description: >-
      Individual usage events reported against an account and either a metric or
      currency.
  - name: Test
    description: Endpoints for test environment maintenance.
  - name: Products
    x-group: Billing
    description: Sellable catalog objects. Products can map to Stripe products.
  - name: Prices
    x-group: Billing
    description: >-
      Simple commercial terms for a product. Contract lines can reference a
      price or a rate card, but not both.
  - name: Rate Cards
    x-group: Billing
    description: Reusable rating policies that convert engine facts into billable amounts.
  - name: Contracts
    x-group: Billing
    description: >-
      Subscription-like commercial agreements. Contracts own contract lines and
      cancellation state.
  - name: Invoice Preview
    x-group: Billing
    description: Read-only preview of LedgerUp invoice lines before any Stripe write.
paths:
  /v2/customers/{customer_id}:
    patch:
      tags:
        - Customers
      summary: Update a customer.
      operationId: updateCustomer
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: LedgerUp customer UUID.
            example: 018f5f0c-1111-7abc-8def-123456789abc
          description: Customer UUID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerUpdateRequest'
      responses:
        '200':
          description: Updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '400':
          $ref: '#/components/responses/BadRequestText'
        '401':
          $ref: '#/components/responses/UnauthorizedText'
        '403':
          $ref: '#/components/responses/ForbiddenText'
        '404':
          $ref: '#/components/responses/NotFoundText'
        '408':
          $ref: '#/components/responses/RequestTimeoutText'
        '409':
          $ref: '#/components/responses/ConflictText'
        '413':
          $ref: '#/components/responses/PayloadTooLargeText'
        '415':
          $ref: '#/components/responses/UnsupportedMediaTypeText'
        '422':
          $ref: '#/components/responses/UnprocessableText'
        '429':
          $ref: '#/components/responses/RateLimitedText'
        '500':
          $ref: '#/components/responses/InternalServerErrorText'
      security:
        - LedgerUpApiKey: []
components:
  schemas:
    CustomerUpdateRequest:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          description: Customer name. Maximum 256 Unicode scalar values.
          maxLength: 256
          example: Acme
        external_id:
          type:
            - string
            - 'null'
          description: Optional caller-supplied external identifier. Send null to clear.
          maxLength: 256
          example: crm_acme_001
        stripe_customer_id:
          type:
            - string
            - 'null'
          description: Optional Stripe customer identifier. Send null to clear.
          maxLength: 256
          example: cus_NffrFeUfNV2Hib
        quickbooks_customer_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Optional QuickBooks customer UUID. Send null to clear.
          example: 018f5f0c-1111-7abc-8def-123456789abc
      description: >-
        Update-customer request. Unknown JSON fields are rejected. Omitted
        fields are unchanged.
    Customer:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          format: uuid
          description: Customer UUID.
          example: 018f5f0c-1111-7abc-8def-123456789abc
        name:
          type: string
          description: Customer name.
          maxLength: 256
          example: Acme
        external_id:
          type:
            - string
            - 'null'
          description: Optional caller-supplied external identifier.
          maxLength: 256
          example: crm_acme_001
        stripe_customer_id:
          type:
            - string
            - 'null'
          description: Optional Stripe customer identifier.
          maxLength: 256
          example: cus_NffrFeUfNV2Hib
        quickbooks_customer_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Optional QuickBooks customer UUID.
          example: 018f5f0c-1111-7abc-8def-123456789abc
        created_at:
          $ref: '#/components/schemas/UnixTimestamp'
        updated_at:
          $ref: '#/components/schemas/UnixTimestamp'
      required:
        - id
        - name
        - external_id
        - stripe_customer_id
        - quickbooks_customer_id
        - created_at
        - updated_at
    UnixTimestamp:
      type: integer
      format: int64
      description: Unix timestamp in seconds.
      example: 1767225600
  responses:
    BadRequestText:
      description: >-
        Bad request, invalid header, invalid amount/quantity/currency, or text
        validation failure.
      content:
        text/plain:
          schema:
            type: string
    UnauthorizedText:
      description: Missing or invalid API key.
      content:
        text/plain:
          schema:
            type: string
            example: Invalid API key
    ForbiddenText:
      description: >-
        API key lacks the required permission, or reset was attempted outside
        the test namespace.
      content:
        text/plain:
          schema:
            type: string
    NotFoundText:
      description: Referenced or requested resource was not found.
      content:
        text/plain:
          schema:
            type: string
            example: not found
    RequestTimeoutText:
      description: Request exceeded the 30 second timeout.
      content:
        text/plain:
          schema:
            type: string
    ConflictText:
      description: Duplicate idempotency key, uniqueness conflict, or foreign-key conflict.
      content:
        text/plain:
          schema:
            type: string
    PayloadTooLargeText:
      description: Request body exceeded the 256 KiB limit.
      content:
        text/plain:
          schema:
            type: string
    UnsupportedMediaTypeText:
      description: Write request content type was not application/json.
      content:
        text/plain:
          schema:
            type: string
    UnprocessableText:
      description: >-
        Semantically invalid request, such as a service period with start
        greater than end.
      content:
        text/plain:
          schema:
            type: string
    RateLimitedText:
      description: Rate limit exceeded.
      content:
        text/plain:
          schema:
            type: string
            example: rate limit exceeded
    InternalServerErrorText:
      description: Internal server error or queue failure.
      content:
        text/plain:
          schema:
            type: string
  securitySchemes:
    LedgerUpApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: LedgerUp API Key.
      x-displayName: LedgerUp API Key

````