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

# Update a customer

> Updates an existing customer identified by reference. Use this to backfill or change fields such as `externalRef`, `name`, or `email`. Only the fields supplied in the body are modified.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/sdk/customers/{reference}
openapi: 3.0.0
info:
  contact: {}
  description: The SolvaPay REST API specification
  title: SolvaPay REST API
  version: '1.0'
servers: []
security: []
tags: []
paths:
  /v1/sdk/customers/{reference}:
    patch:
      tags:
        - Customers
      summary: Update a customer
      description: >-
        Updates an existing customer identified by reference. Use this to
        backfill or change fields such as `externalRef`, `name`, or `email`.
        Only the fields supplied in the body are modified.
      operationId: CustomerSdkController_updateCustomer
      parameters:
        - description: Customer reference identifier
          in: path
          name: reference
          required: true
          schema:
            example: cus_3c4d5e6f7g8h
            type: string
      requestBody:
        content:
          application/json:
            examples:
              linkExternalRef:
                summary: Backfill externalRef
                value:
                  externalRef: auth_user_12345
              updateProfile:
                summary: Update name and email
                value:
                  email: jane@example.com
                  name: Jane Doe
            schema:
              $ref: '#/components/schemas/UpdateCustomerRequest'
        description: Fields to update (all optional)
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponse'
          description: Customer updated successfully
        '400':
          description: Invalid update payload
        '404':
          description: Customer not found
      security:
        - SecretKey: []
components:
  schemas:
    UpdateCustomerRequest:
      properties:
        description:
          maxLength: 1000
          pattern: ^[\p{L}\p{N}\s.,'"&\/()+:%;?!@#_[\]\-]*$
          type: string
        email:
          format: email
          type: string
        externalRef:
          maxLength: 50
          type: string
        metadata: {}
        name:
          maxLength: 100
          pattern: ^[\p{L}\p{N} .,'"&\/()+:\-]*$
          type: string
        telephone:
          oneOf:
            - pattern: ^\+[1-9]\d{6,14}$
              type: string
            - enum:
                - ''
              type: string
      type: object
    CustomerResponse:
      properties:
        email:
          description: Customer email address
          example: customer@example.com
          type: string
        externalRef:
          description: >-
            External reference ID from your auth system (if set during creation
            or update)
          example: auth_user_12345
          type: string
        name:
          description: Customer full name
          example: John Doe
          type: string
        purchases:
          description: Active purchases
          items:
            $ref: '#/components/schemas/PurchaseInfo'
          type: array
        reference:
          description: Customer reference identifier
          example: cus_3c4d5e6f7g8h
          type: string
      required:
        - reference
        - name
        - email
      type: object
    PurchaseInfo:
      properties:
        amount:
          description: Amount in USD cents (normalised for aggregation)
          example: 9900
          type: number
        cancellationReason:
          description: Reason for cancellation
          example: Customer request
          type: string
        cancelledAt:
          description: When purchase was cancelled
          example: '2025-10-28T10:00:00Z'
          type: string
        currency:
          description: ISO 4217 currency code of the customer-facing charge
          example: GBP
          type: string
        endDate:
          description: End date of purchase
          example: '2025-11-27T10:00:00Z'
          type: string
        exchangeRate:
          description: Exchange rate from original currency to USD
          example: 1.32
          type: number
        originalAmount:
          description: Original amount in the payment currency (minor units)
          example: 7500
          type: number
        planRef:
          description: Plan reference from the plan snapshot, for reliable plan matching
          example: pln_abc123
          type: string
        planSnapshot:
          description: Snapshot of the plan at time of purchase
          type: object
        productName:
          description: Product name
          example: API Gateway Manager
          type: string
        productRef:
          description: Product reference
          example: prd_abc123
          type: string
        reference:
          description: Purchase reference
          example: pur_1A2B3C4D
          type: string
        startDate:
          description: Start date
          example: '2025-10-27T10:00:00Z'
          type: string
        status:
          description: Purchase status
          example: active
          type: string
      required:
        - reference
        - productName
        - status
        - startDate
        - amount
        - currency
      type: object
  securitySchemes:
    SecretKey:
      bearerFormat: JWT
      description: >-
        Provider secret API key (sk_live_… / sk_test_…) supplied as a Bearer
        token.
      scheme: bearer
      type: http

````