> ## Documentation Index
> Fetch the complete documentation index at: https://loyalty-interchange.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Enroll or return a member



## OpenAPI

````yaml /api-reference/openapi.yaml post /members/enroll
openapi: 3.1.2
info:
  title: Loyalty Interchange Protocol
  version: 0.1.0
  description: Vendor-neutral loyalty transaction API with the foodservice/1.0 profile.
  license:
    name: Apache-2.0
    identifier: Apache-2.0
servers:
  - url: https://loyalty.example.com/lip/v1
security:
  - bearerAuth: []
tags:
  - name: Discovery
  - name: Programs
  - name: Accounts
  - name: Ledger
  - name: Members
  - name: Orders
  - name: Accruals
  - name: Redemptions
  - name: Issued Rewards
paths:
  /members/enroll:
    post:
      tags:
        - Members
      summary: Enroll or return a member
      operationId: enrollMember
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemberEnrollRequest'
      responses:
        '201':
          description: Enroll or return a member
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemberEnrollResponse'
        default:
          $ref: '#/components/responses/Problem'
components:
  schemas:
    MemberEnrollRequest:
      title: MemberEnrollRequest
      additionalProperties: false
      type: object
      required:
        - context
        - program_id
        - identity
      properties:
        context:
          additionalProperties: false
          type: object
          required:
            - protocol_version
            - profile
            - request_id
            - idempotency_key
            - occurred_at
            - source
          properties:
            protocol_version:
              const: '1.0'
              type: string
            profile:
              const: foodservice/1.0
              type: string
            request_id:
              minLength: 1
              maxLength: 128
              pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
              description: Opaque, stable identifier within the owning system.
              type: string
            idempotency_key:
              minLength: 8
              maxLength: 255
              type: string
            occurred_at:
              format: date-time
              type: string
            source:
              additionalProperties: false
              type: object
              required:
                - system
              properties:
                system:
                  minLength: 1
                  maxLength: 128
                  pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                  description: Opaque, stable identifier within the owning system.
                  type: string
                instance:
                  minLength: 1
                  maxLength: 128
                  pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                  description: Opaque, stable identifier within the owning system.
                  type: string
        program_id:
          minLength: 1
          maxLength: 128
          pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
          description: Opaque, stable identifier within the owning system.
          type: string
        identity:
          additionalProperties: false
          type: object
          required:
            - type
            - value
          properties:
            type:
              anyOf:
                - const: loyalty_id
                  type: string
                - const: token
                  type: string
                - const: email_hash
                  type: string
                - const: phone_hash
                  type: string
                - const: external
                  type: string
            value:
              minLength: 1
              maxLength: 512
              type: string
            issuer:
              minLength: 1
              maxLength: 128
              pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
              description: Opaque, stable identifier within the owning system.
              type: string
        member_id:
          minLength: 1
          maxLength: 128
          pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
          description: Opaque, stable identifier within the owning system.
          type: string
        attributes:
          description: Non-normative extension data. Consumers must ignore unknown keys.
          type: object
          patternProperties:
            ^(.*)$: {}
    MemberEnrollResponse:
      title: MemberEnrollResponse
      additionalProperties: false
      type: object
      required:
        - context
        - member
        - balances
      properties:
        context:
          additionalProperties: false
          type: object
          required:
            - protocol_version
            - profile
            - request_id
            - processed_at
          properties:
            protocol_version:
              const: '1.0'
              type: string
            profile:
              const: foodservice/1.0
              type: string
            request_id:
              minLength: 1
              maxLength: 128
              pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
              description: >-
                Echoes the request's request_id. On an idempotent replay it
                echoes the replaying request's request_id, not the original.
              type: string
            processed_at:
              format: date-time
              type: string
        member:
          additionalProperties: false
          type: object
          required:
            - member_id
            - program_id
            - status
            - joined_at
            - identities
          properties:
            member_id:
              minLength: 1
              maxLength: 128
              pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
              description: Opaque, stable identifier within the owning system.
              type: string
            program_id:
              minLength: 1
              maxLength: 128
              pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
              description: Opaque, stable identifier within the owning system.
              type: string
            status:
              anyOf:
                - const: active
                  type: string
                - const: suspended
                  type: string
                - const: closed
                  type: string
            joined_at:
              format: date-time
              type: string
            tier_id:
              minLength: 1
              maxLength: 128
              pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
              description: Opaque, stable identifier within the owning system.
              type: string
            identities:
              minItems: 1
              type: array
              items:
                additionalProperties: false
                type: object
                required:
                  - type
                  - value
                properties:
                  type:
                    anyOf:
                      - const: loyalty_id
                        type: string
                      - const: token
                        type: string
                      - const: email_hash
                        type: string
                      - const: phone_hash
                        type: string
                      - const: external
                        type: string
                  value:
                    minLength: 1
                    maxLength: 512
                    type: string
                  issuer:
                    minLength: 1
                    maxLength: 128
                    pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                    description: Opaque, stable identifier within the owning system.
                    type: string
            attributes:
              description: >-
                Non-normative extension data. Consumers must ignore unknown
                keys.
              type: object
              patternProperties:
                ^(.*)$: {}
        balances:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - account_id
              - member_id
              - program_id
              - unit
              - amount
              - reserved
              - available
              - as_of
            properties:
              account_id:
                minLength: 1
                maxLength: 128
                pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                description: Opaque, stable identifier within the owning system.
                type: string
              member_id:
                minLength: 1
                maxLength: 128
                pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                description: Opaque, stable identifier within the owning system.
                type: string
              program_id:
                minLength: 1
                maxLength: 128
                pattern: ^[A-Za-z0-9][A-Za-z0-9._:-]*$
                description: Opaque, stable identifier within the owning system.
                type: string
              unit:
                anyOf:
                  - const: points
                    type: string
                  - const: visits
                    type: string
                  - const: stamps
                    type: string
                  - const: credits
                    type: string
                  - const: custom
                    type: string
              unit_label:
                minLength: 1
                maxLength: 64
                type: string
              amount:
                type: integer
              reserved:
                minimum: 0
                type: integer
              available:
                type: integer
              as_of:
                format: date-time
                type: string
    ProblemDetails:
      title: ProblemDetails
      additionalProperties: true
      type: object
      required:
        - type
        - title
        - status
      properties:
        type:
          format: uri-reference
          type: string
        title:
          minLength: 1
          type: string
        status:
          minimum: 400
          maximum: 599
          type: integer
        detail:
          type: string
        instance:
          format: uri-reference
          type: string
        code:
          minLength: 1
          maxLength: 128
          type: string
        errors:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - path
              - message
            properties:
              path:
                type: string
              message:
                type: string
  responses:
    Problem:
      description: RFC 9457 problem details
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````