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

# Create member

> ⚠️ **BETA endpoint**

This is a work-in-progress documentation of a BETA endpoint. The parameters, fields, request and response bodies, and other data may subject to change. If you want to share feedback or improvements, contact Voucherify support or your Technical Account Manager.

Creates a new member in the specified program. The customer must exist and the program must be in ACTIVE status.
Cards are automatically created for the member based on the program's card definition assignments.
Returns the member with their assigned cards.

**Note:** Card code generation is asynchronous. Cards will appear in the response, but the `code` field may be `null` immediately after creation. The code is generated asynchronously and becomes available shortly after.




## OpenAPI

````yaml /openapi/loyalties-v2.json post /v2/loyalties/programs/{programId}/members
openapi: 3.1.0
info:
  title: Voucherify Loyalty v2 API
  version: 2.0.0
  description: >-
    Complete API documentation for Voucherify Loyalty v2 system. Requires
    LOYALTY_V2 feature flag.
servers:
  - url: https://api.voucherify.io
    description: Production
security:
  - bearerAuth: []
    X-App-Id: []
    X-App-Token: []
tags:
  - name: Card Definitions
    description: >-
      CRUD operations, lifecycle management, and activity history for card
      definitions. Card definitions describe the configuration for loyalty
      cards, including code generation, points expiration, earning/spending
      limits, pending points, refunds, and balance settings.
  - name: Programs
    description: >-
      Loyalty program CRUD, lifecycle management, program-scoped resource
      assignments (card definitions, earning rules, rewards, tier structures),
      member management (create, list, get, activate, deactivate, delete), card
      operations (points adjustment, pending points, expiring points,
      transactions), reward purchases, and activity history.
  - name: Earning Rules
    description: >-
      Manage earning rules that define how customers earn points or receive
      incentives based on triggers (events, segments, custom events). Includes
      CRUD, lifecycle, and activity history.
  - name: Tier Structures
    description: >-
      CRUD operations, lifecycle management, and activity history for tier
      structures. Includes nested tier definitions (create, list, update,
      delete) within tier structures. Tier structures define the tiering model
      for loyalty programs — how members qualify for and move between tiers.
  - name: Incentives
    description: >-
      Manage incentive definitions (fixed points, proportional points, material,
      digital). Includes CRUD, lifecycle transitions, and activity history.
  - name: Rewards
    description: >-
      CRUD, lifecycle operations, and activity history for reward definitions.
      Rewards can be material (product/SKU) or digital (discount coupons, gift
      vouchers).
  - name: Examine
    description: Examines the earning of loyalty points for a loyalty program member.
paths:
  /v2/loyalties/programs/{programId}/members:
    post:
      tags:
        - Programs
      summary: Create member
      description: >
        ⚠️ **BETA endpoint**


        This is a work-in-progress documentation of a BETA endpoint. The
        parameters, fields, request and response bodies, and other data may
        subject to change. If you want to share feedback or improvements,
        contact Voucherify support or your Technical Account Manager.


        Creates a new member in the specified program. The customer must exist
        and the program must be in ACTIVE status.

        Cards are automatically created for the member based on the program's
        card definition assignments.

        Returns the member with their assigned cards.


        **Note:** Card code generation is asynchronous. Cards will appear in the
        response, but the `code` field may be `null` immediately after creation.
        The code is generated asynchronously and becomes available shortly
        after.
      operationId: createMember
      parameters:
        - $ref: '#/components/parameters/MemberProgramId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemberCreateRequest'
      responses:
        '200':
          description: Member created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemberWithCardsResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Member already exists for this customer and program
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '423':
          description: Program is not in ACTIVE status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    MemberProgramId:
      name: programId
      in: path
      required: true
      description: Unique program identifier
      schema:
        type: string
  schemas:
    MemberCreateRequest:
      type: object
      required:
        - customer_id
      properties:
        customer_id:
          type: string
          description: ID of an existing customer to enroll as a member
          pattern: ^cust_[A-Za-z0-9]+$
        status:
          type:
            - string
            - 'null'
          enum:
            - ACTIVE
            - INACTIVE
            - null
          default: ACTIVE
          description: Initial member status (defaults to ACTIVE)
        metadata:
          oneOf:
            - $ref: '#/components/schemas/Metadata'
            - type: 'null'
          description: Custom key-value metadata
      additionalProperties: false
    MemberWithCardsResponse:
      allOf:
        - $ref: '#/components/schemas/MemberResponse'
        - type: object
          properties:
            cards:
              type:
                - array
                - 'null'
              items:
                $ref: '#/components/schemas/MemberCard'
              description: Cards assigned to this member
    ErrorResponse:
      type: object
      description: Standard error response.
      properties:
        code:
          type: integer
          description: HTTP status code.
        key:
          type: string
          description: Machine-readable error key.
        message:
          type: string
          description: Human-readable error message.
        details:
          type: string
          description: Additional error details.
        request_id:
          type:
            - string
            - 'null'
          description: Request identifier for tracing.
        resource_id:
          type: string
          description: Related resource identifier (when applicable).
        resource_type:
          type: string
          description: Related resource type (when applicable).
      required:
        - code
        - key
        - message
    Metadata:
      type: object
      description: Custom key-value metadata.
      additionalProperties: true
    MemberResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique member identifier
        customer_id:
          type: string
          description: Associated customer identifier
        program_id:
          type: string
          description: Program the member belongs to
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
            - DELETED
          description: Current member status
        metadata:
          type: object
          description: Custom key-value metadata
          additionalProperties: true
        created_at:
          type: string
          format: date-time
          description: ISO 8601 creation timestamp
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 last update timestamp
        object:
          type: string
          const: member
    MemberCard:
      type: object
      description: A card assignment with card details for a member
      properties:
        member_role:
          type: string
          description: Role of the member for this card assignment
        created_at:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the card was assigned
        card:
          oneOf:
            - $ref: '#/components/schemas/CardSimple'
            - type: 'null'
        object:
          type: string
          const: member_card
    CardSimple:
      type: object
      description: Simplified card representation (used in member card listings)
      properties:
        id:
          type: string
        card_definition_id:
          type: string
        card_type:
          type: string
        code:
          type:
            - string
            - 'null'
          description: >-
            Card code. May be `null` when code generation is still pending —
            codes are generated asynchronously after member creation.
        lifetime_bucket:
          $ref: '#/components/schemas/CardLifetimeBucket'
        balance:
          $ref: '#/components/schemas/CardBalance'
        next_expiration:
          oneOf:
            - $ref: '#/components/schemas/CardNextExpiration'
            - type: 'null'
        next_activation:
          oneOf:
            - $ref: '#/components/schemas/CardNextActivation'
            - type: 'null'
        object:
          type: string
          const: card
    CardLifetimeBucket:
      type: object
      description: Lifetime aggregated point counters for a card
      properties:
        points:
          $ref: '#/components/schemas/CardLifetimeBucketPoints'
        pending_points:
          $ref: '#/components/schemas/CardLifetimeBucketPendingPoints'
    CardBalance:
      type: object
      description: >
        Current available balance.

        points = total - subtracted - expired - spent - refunded + returned -
        locked + unlocked

        pending_points = max(total - activated - canceled, 0)
      properties:
        points:
          type: integer
          description: Current available points balance
        pending_points:
          type: integer
          description: Current available pending points balance
    CardNextExpiration:
      type: object
      description: Information about the next upcoming points expiration
      properties:
        points:
          type: integer
          description: Number of points expiring next
        date:
          type: string
          format: date
          description: Date when points will expire (ISO 8601 date)
    CardNextActivation:
      type: object
      description: Information about the next upcoming pending points activation
      properties:
        points:
          type: integer
          description: Number of pending points activating next
        type:
          type: string
          description: Type of pending points activation
        date:
          type:
            - string
            - 'null'
          format: date
          description: >-
            Date when pending points will activate (not present for EVENT_BASED
            type)
        cancel_date:
          type:
            - string
            - 'null'
          format: date
          description: >-
            Date when pending points will be auto-canceled (only for EVENT_BASED
            type)
    CardLifetimeBucketPoints:
      type: object
      description: Lifetime point counters broken down by type
      properties:
        total:
          type: integer
          description: Total accumulated points (earned + added + activated from pending)
        earned:
          type: integer
          description: Points earned via earning rules
        added:
          type: integer
          description: Points added manually (ADMIN_CREDIT)
        subtracted:
          type: integer
          description: Points subtracted manually (ADMIN_DEBIT)
        expired:
          type: integer
          description: Points that have expired
        spent:
          type: integer
          description: Points spent on rewards
        refunded:
          type: integer
          description: Points refunded (earned by returned products)
        returned:
          type: integer
          description: Points returned (from returned reward purchases)
        locked:
          type: integer
          description: Points locked (by locked reward purchases)
        unlocked:
          type: integer
          description: Points unlocked (from unlocked reward purchases)
    CardLifetimeBucketPendingPoints:
      type: object
      description: Lifetime pending point counters
      properties:
        total:
          type: integer
          description: Total pending points added
        activated:
          type: integer
          description: Pending points that have been activated
        canceled:
          type: integer
          description: Pending points that have been canceled
  responses:
    BadRequest:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header

````