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

# Update a customer

> Updates a customer. Currently only metadata updates are supported.
Adds or replaces the supplied metadata keys, preserving omitted keys.
Updates the metadata returned by customer reads and included in subsequent webhook payloads.
Requires a product-scoped API key, or a partner-scoped key with an `x-imprint-merchant-key` header.
The customer must have an account for that product. Customer linkage is unchanged.
Send at least one key. Values must be strings; null values and the reserved
`partner_customer_id` key are rejected. Product-specific metadata rules apply to supplied keys;
omitted required keys are allowed. An empty string is stored as a value, not a deletion,
unless the key is required by the product.
`loyalty_id` is read-only for products where Imprint generates the loyalty ID.




## OpenAPI

````yaml /api-reference/2025-05-05/openapi.yaml patch /v2/customers/{customer_id}
openapi: 3.1.0
info:
  title: Public Imprint API
  version: '2.0'
servers:
  - url: https://dev.sbx.imprint.co
    description: Imprint public api sandbox
security:
  - basicAuth: []
  - bearerAuth: []
paths:
  /v2/customers/{customer_id}:
    patch:
      tags:
        - Customers
      summary: Update a customer
      description: >
        Updates a customer. Currently only metadata updates are supported.

        Adds or replaces the supplied metadata keys, preserving omitted keys.

        Updates the metadata returned by customer reads and included in
        subsequent webhook payloads.

        Requires a product-scoped API key, or a partner-scoped key with an
        `x-imprint-merchant-key` header.

        The customer must have an account for that product. Customer linkage is
        unchanged.

        Send at least one key. Values must be strings; null values and the
        reserved

        `partner_customer_id` key are rejected. Product-specific metadata rules
        apply to supplied keys;

        omitted required keys are allowed. An empty string is stored as a value,
        not a deletion,

        unless the key is required by the product.

        `loyalty_id` is read-only for products where Imprint generates the
        loyalty ID.
      operationId: updateCustomer
      parameters:
        - name: customer_id
          in: path
          required: true
          description: The unique identifier for the Imprint customer
          schema:
            type: string
            example: BBB815E9-F654-438D-9AD3-3F7BB8136FC0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - metadata
              properties:
                metadata:
                  type: object
                  minProperties: 1
                  additionalProperties:
                    type: string
                    x-go-type: '*string'
                  example:
                    loyalty_id: '036000241457'
                    membership_tier: gold
      responses:
        '200':
          description: >-
            Customer metadata updated successfully; returns all stored metadata
            keys
          content:
            application/json:
              schema:
                type: object
                required:
                  - metadata
                properties:
                  metadata:
                    type: object
                    additionalProperties:
                      type: string
        '400':
          description: Invalid or missing customer metadata
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidRequestError'
        '404':
          description: Customer not found for the selected product
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerNotFoundError'
components:
  schemas:
    InvalidRequestError:
      type: object
      properties:
        path:
          type: string
          description: The path of the endpoint returning the error
          example: /v2/customers
        details:
          type: array
          items:
            type: string
          description: The details of the error being returned
          example:
            - 'email: must be a well-formed email address'
        error:
          type: string
          description: The category of error being returned
          example: Bad Request
        status:
          type: integer
          description: The HTTP status code of the error
          example: 400
        timestamp:
          type: string
          description: The timestamp that the error occurred
          example: '2025-01-20T18:18:22.923+00:00'
    CustomerNotFoundError:
      type: object
      required:
        - type
        - message
      properties:
        type:
          type: string
          description: The category of error being returned
          example: CUSTOMER_NOT_FOUND_ERROR
        message:
          type: string
          description: A message describing the cause of the error
          example: 'Customer not found for provided ID: CSMR-v1-123'
        param:
          type: string
          description: The param causing the error
          example: customer_id
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Basic HTTP authentication. Allowed headers-- Authorization: Basic
        <base64(api_key_id:api_key_secret)>
    bearerAuth:
      bearerFormat: auth-scheme
      description: >-
        Bearer HTTP authentication. Allowed headers-- Authorization: Bearer
        <api_key>
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.