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

# Update Customer



## OpenAPI

````yaml /api-reference/v2/openapi.json PATCH /v2/customers/{merchant_id}
openapi: 3.1.1
info:
  title: LoyaltyLion Admin API
  version: v2
servers:
  - url: https://api.loyaltylion.com
security: []
tags:
  - name: identity
  - name: activities
  - name: orders
  - name: transactions
  - name: customers
  - name: webhooks
  - name: emails
  - name: sites
  - name: reviews
  - name: rewards
  - name: integrations
  - name: gatsby
paths:
  /v2/customers/{merchant_id}:
    patch:
      tags:
        - customers
      operationId: customers.updateCustomer
      parameters:
        - name: merchant_id
          in: path
          required: true
          schema:
            type: string
          description: The ID of the customer in your platform or ecommerce store
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomersUpdateCustomerRequestBody'
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomersUpdateCustomerResponseBody'
        '400':
          $ref: '#/components/responses/ClientErrorBadRequest'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type: string
                    required:
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                      details:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties:
                          type: string
                    required:
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '404':
          description: '404'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                additionalProperties: false
      security:
        - ProgramApiKey:
            - write_customers
        - SiteTokenSecret: []
components:
  schemas:
    CustomersUpdateCustomerRequestBody:
      type: object
      properties:
        customer:
          type: object
          properties:
            birthday:
              type: string
            blocked:
              type: boolean
          additionalProperties: false
      required:
        - customer
      additionalProperties: false
    CustomersUpdateCustomerResponseBody:
      type: object
      properties:
        customer:
          type: object
          properties:
            id:
              type: number
            merchant_id:
              type: string
            email:
              type:
                - string
                - 'null'
            points_approved:
              type: number
            points_pending:
              type: number
            points_spent:
              type: number
            properties:
              type: object
              propertyNames:
                type: string
              additionalProperties: {}
            metadata:
              type: object
              properties:
                shopify_source_url:
                  type: string
              additionalProperties: false
            rewards_claimed:
              type: integer
              minimum: 0
            rewards_used:
              anyOf:
                - type: integer
                  minimum: 0
                - type: 'null'
            blocked:
              type: boolean
            guest:
              type: boolean
            enrolled:
              type: boolean
            enrolled_at:
              type:
                - string
                - 'null'
            referral_id:
              type:
                - string
                - 'null'
            referred_by:
              anyOf:
                - type: object
                  properties:
                    id:
                      type: number
                    merchant_id:
                      type: string
                  required:
                    - id
                    - merchant_id
                  additionalProperties: false
                - type: 'null'
            loyalty_tier_membership:
              anyOf:
                - type: object
                  properties:
                    started_at:
                      type: string
                    expires_at:
                      type:
                        - string
                        - 'null'
                    manual:
                      type:
                        - boolean
                        - 'null'
                    loyalty_tier:
                      type: object
                      properties:
                        id:
                          type: number
                        name:
                          type: string
                        number:
                          type: number
                          minimum: 1
                        default:
                          type: boolean
                        hidden:
                          type: boolean
                        lower_bound:
                          type: string
                        upper_bound:
                          type:
                            - string
                            - 'null'
                        position:
                          type: number
                          minimum: 0
                      required:
                        - id
                        - name
                        - number
                        - default
                        - hidden
                        - lower_bound
                        - upper_bound
                        - position
                      additionalProperties: false
                  required:
                    - started_at
                    - expires_at
                    - manual
                    - loyalty_tier
                  additionalProperties: false
                - type: 'null'
            tier_eligibility:
              anyOf:
                - oneOf:
                    - $ref: '#/components/schemas/TierEligibilityPoints'
                    - $ref: '#/components/schemas/TierEligibilitySpend'
                  type: object
                  discriminator:
                    propertyName: kind
                    mapping:
                      points:
                        $ref: '#/components/schemas/TierEligibilityPoints'
                      spend:
                        $ref: '#/components/schemas/TierEligibilitySpend'
                - type: 'null'
            insights_segment:
              anyOf:
                - type: string
                  enum:
                    - At Risk
                    - Win Back
                    - Loyal
                - type: 'null'
            birthday:
              type:
                - string
                - 'null'
            referral_url:
              type: string
            receipt_upload_url:
              type:
                - string
                - 'null'
            linked_merchant_ids:
              type: array
              items:
                type: string
            created_at:
              type: string
            updated_at:
              type: string
          required:
            - id
            - merchant_id
            - email
            - points_approved
            - points_pending
            - points_spent
            - properties
            - metadata
            - rewards_claimed
            - rewards_used
            - blocked
            - guest
            - enrolled
            - enrolled_at
            - referral_id
            - referred_by
            - loyalty_tier_membership
            - tier_eligibility
            - insights_segment
            - birthday
            - referral_url
            - receipt_upload_url
            - created_at
            - updated_at
          additionalProperties: false
      required:
        - customer
      additionalProperties: false
    TierEligibilityPoints:
      title: Points
      type: object
      properties:
        kind:
          type: string
          const: points
        valid_until:
          description: >-
            ISO 8601 timestamp representing when the calculated progress is no
            longer accurate. After this date, progress values may be stale — for
            example, because contributing activities or spend have fallen
            outside the evaluation window. Null for lifetime tiers.
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: 'null'
        tier_points:
          type: object
          properties:
            now:
              description: >-
                The number of points contributing to tier progress as of right
                now. This is equivalent to the number of eligible points from
                now, back to the start of the evaluation window.
              type: number
            at_expiration:
              description: >-
                The predicted number of points contributing to tier progress as
                of the current tier's expiration date. Null if the membership
                never expires (e.g. lifetime tiers).
              type:
                - number
                - 'null'
          required:
            - now
            - at_expiration
          additionalProperties: false
        points_needed_for_renewal:
          description: >-
            The number of additional points required to renew the current tier
            when the current membership expires. Null if the membership does not
            expire (e.g. lifetime tiers), or if the current membership is for
            the default tier.
          type:
            - number
            - 'null'
        points_needed_for_upgrade:
          description: >-
            The number of additional points required to move into the next tier.
            Null if there is no eligible next tier.
          type:
            - number
            - 'null'
        upgrade_tier:
          description: >-
            The next tier that this customer could upgrade to from their current
            tier. Null if the customer is already at the highest tier.
          anyOf:
            - type: object
              properties:
                id:
                  type: number
                name:
                  type: string
                threshold:
                  description: >-
                    The threshold required to reach this tier. For points
                    programs, this is the number of points. For spend programs,
                    this is the spend amount in minor units (e.g. cents); the
                    currency is determined by the program configuration.
                  type: number
              required:
                - id
                - name
                - threshold
              additionalProperties: false
            - type: 'null'
        forecasted_tier:
          description: >-
            The tier the customer is forecasted to be in at their membership
            expiration, based on their predicted points at expiration. Null if
            the membership never expires (e.g. lifetime tiers, default tier
            memberships, or conditional tier memberships).
          anyOf:
            - type: object
              properties:
                id:
                  type: number
                name:
                  type: string
              required:
                - id
                - name
              additionalProperties: false
            - type: 'null'
      required:
        - kind
        - valid_until
        - tier_points
        - points_needed_for_renewal
        - points_needed_for_upgrade
        - upgrade_tier
        - forecasted_tier
      additionalProperties: false
    TierEligibilitySpend:
      title: Spend
      type: object
      properties:
        kind:
          type: string
          const: spend
        valid_until:
          description: >-
            ISO 8601 timestamp representing when the calculated progress is no
            longer accurate. After this date, progress values may be stale — for
            example, because contributing activities or spend have fallen
            outside the evaluation window. Null for lifetime tiers.
          anyOf:
            - type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            - type: 'null'
        tier_spend:
          type: object
          properties:
            now:
              $ref: '#/components/schemas/CurrencyAmount'
              title: Currency
              description: >-
                The amount of spend contributing to tier progress as of right
                now. This is equivalent to the amount of eligible spend from
                now, back to the start of the evaluation window.
            at_expiration:
              description: >-
                The predicted amount of spend contributing to tier progress as
                of the current tier's expiration date. Null if the membership
                never expires (e.g. lifetime tiers).
              anyOf:
                - $ref: '#/components/schemas/CurrencyAmount'
                - type: 'null'
          required:
            - now
            - at_expiration
          additionalProperties: false
        spend_needed_for_renewal:
          description: >-
            The amount of additional spend required to renew the current tier
            when the current membership expires. Null if the membership does not
            expire (e.g. lifetime tiers), or if the current membership is for
            the default tier.
          anyOf:
            - $ref: '#/components/schemas/CurrencyAmount'
            - type: 'null'
        spend_needed_for_upgrade:
          description: >-
            The amount of additional spend required to move into the next tier.
            Null if there is no eligible next tier.
          anyOf:
            - $ref: '#/components/schemas/CurrencyAmount'
            - type: 'null'
        upgrade_tier:
          description: >-
            The next tier that this customer could upgrade to from their current
            tier. Null if the customer is already at the highest tier.
          anyOf:
            - type: object
              properties:
                id:
                  type: number
                name:
                  type: string
                threshold:
                  description: >-
                    The threshold required to reach this tier. For points
                    programs, this is the number of points. For spend programs,
                    this is the spend amount in minor units (e.g. cents); the
                    currency is determined by the program configuration.
                  type: number
              required:
                - id
                - name
                - threshold
              additionalProperties: false
            - type: 'null'
        forecasted_tier:
          description: >-
            The tier the customer is forecasted to be in at their membership
            expiration, based on their predicted spend at expiration. Null if
            the membership never expires (e.g. lifetime tiers, default tier
            memberships, or conditional tier memberships).
          anyOf:
            - type: object
              properties:
                id:
                  type: number
                name:
                  type: string
              required:
                - id
                - name
              additionalProperties: false
            - type: 'null'
      required:
        - kind
        - valid_until
        - tier_spend
        - spend_needed_for_renewal
        - spend_needed_for_upgrade
        - upgrade_tier
        - forecasted_tier
      additionalProperties: false
    CurrencyAmount:
      title: Currency
      type: object
      properties:
        amount:
          example: 9.9
          description: >-
            Currency amount as a numeric value. This may be an integer or a
            float depending on the value and the currency. Currencies that do
            not use a decimal point will always be an integer
          type: number
        formatted:
          example: $9.90
          description: >-
            Formatted amount as string with currency symbol, e.g. `$50` or
            `$10.50`
          type: string
      required:
        - amount
        - formatted
      additionalProperties: false
  responses:
    ClientErrorBadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  message:
                    type: string
                  details:
                    type: object
                    additionalProperties:
                      type: string
                required:
                  - message
            required:
              - error
  securitySchemes:
    ProgramApiKey:
      type: http
      scheme: bearer
      description: >-
        An API key linked to a Program in LoyaltyLion, with a set of permissions
        (scopes). API keys can be created manually, or acquired through an
        OAuth2 flow. The API key should be provided as a `Bearer` token in the
        `Authorization` header
    SiteTokenSecret:
      type: http
      scheme: basic
      description: >-
        [DEPRECATED] Authenticate using a LoyaltyLion site's `token` as
        username, and its `secret` as the password. This authentication method
        is deprecated and will be removed in future. Use the `ProgramApiKey`
        authentication method instead

````