title: Customer
type: object
x-tags:
  - Models
description: A customer profile.
required:
  - uuid
  - mobile_number
  - status
  - name
  - email_address
  - dob
  - customer_tier
  - lifetime_qualifying_spend
  - tier_progress
  - created_at
  - updated_at
properties:
  uuid:
    type: string
    format: uuid
    readOnly: true
    description: The customer's unique identifier.
  mobile_number:
    $ref: ./PhoneNumber.yaml
  status:
    $ref: ./CustomerStatus.yaml
    readOnly: true
  name:
    type:
      - string
      - 'null'
    minLength: 1
    maxLength: 255
    description: The customer's name (if known).
  email_address:
    type:
      - string
      - 'null'
    format: email
    minLength: 1
    maxLength: 255
    description: The customer's email address (if known).
  dob:
    type:
      - string
      - 'null'
    format: date
    description: |-
      The customer's date of birth (if known).

      This date is relative to the merchant's timezone (i.e. it is not necessarily UTC).
  customer_tier:
    oneOf:
      - type: 'null'
      - $ref: ./CustomerTier.yaml
        required:
          - uuid
    readOnly: true
    description: The customer's current tier and its current settings, or `null` when no tier is assigned.
  lifetime_qualifying_spend:
    allOf:
      - $ref: ./Money.yaml
      - type: object
        properties:
          amount:
            minimum: 0
    readOnly: true
    description: |-
      The customer's authoritative lifetime qualifying spend.

      Accepted order updates, refunds and cancellations can reduce this value to a minimum of zero. Reductions do not downgrade the customer's tier or reverse previously awarded benefits.
  tier_progress:
    oneOf:
      - type: 'null'
      - type: object
        required:
          - next_tier
          - spending_remaining
        properties:
          next_tier:
            $ref: ./CustomerTier.yaml
            required:
              - uuid
              - spending_requirement
            properties:
              spending_requirement:
                $ref: ./PositiveMoney.yaml
            description: The next active tier available through an automatic upgrade. Its spending requirement is the
              lifetime qualifying spend needed to reach it.
          spending_remaining:
            allOf:
              - $ref: ./Money.yaml
              - type: object
                properties:
                  amount:
                    minimum: 1
                    maximum: 4294967295
            description: The additional qualifying spend required to attain the next automatic tier.
    readOnly: true
    description: The customer's progress towards the next automatic tier, or `null` when no further automatic tier
      is available.
  created_at:
    type: string
    format: date-time
    readOnly: true
    description: The date-time that the customer was first created.
  updated_at:
    type: string
    format: date-time
    readOnly: true
    description: The date-time that the customer was last updated.
