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

# Batch assign/unassign tier structures

> ⚠️ **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.

Assigns and/or unassigns tier structures to/from a program in a single batch.
Unassign operations require the program to be in DRAFT status.




## OpenAPI

````yaml /openapi/loyalties-v2.json post /v2/loyalties/programs/{id}/tier-structures/batch
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/{id}/tier-structures/batch:
    post:
      tags:
        - Programs
        - Programs
      summary: Batch assign/unassign tier structures
      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.


        Assigns and/or unassigns tier structures to/from a program in a single
        batch.

        Unassign operations require the program to be in DRAFT status.
      operationId: batchProcessTierStructures
      parameters:
        - $ref: '#/components/parameters/ProgramId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TierStructuresBatchRequest'
      responses:
        '200':
          description: Batch processing result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TierStructuresBatchResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    ProgramId:
      name: id
      in: path
      required: true
      description: Unique program identifier
      schema:
        type: string
        pattern: ^lprg_[a-f0-9]+$
  schemas:
    TierStructuresBatchRequest:
      type: object
      properties:
        assign:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/TierStructureAssignRef'
          maxItems: 10
          description: Tier structures to assign
        unassign:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/TierStructureUnassignRef'
          maxItems: 10
          description: Tier structures to unassign
      additionalProperties: false
    TierStructuresBatchResponse:
      type: object
      properties:
        assigned:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ProgramTierStructureDTO'
          description: Successfully assigned tier structures (null if no assign operations)
        unassigned:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/ProgramTierStructureDTO'
          description: >-
            Successfully unassigned tier structures (null if no unassign
            operations)
    TierStructureAssignRef:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          pattern: ^lts_[a-f0-9]+$
          description: Tier structure id to assign
      additionalProperties: false
    TierStructureUnassignRef:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          pattern: ^lts_[a-f0-9]+$
          description: Tier structure id to unassign
      additionalProperties: false
    ProgramTierStructureDTO:
      type: object
      description: Tier structure assignment DTO (VLProgramTierStructureDTO)
      properties:
        tier_structure_id:
          type: string
          pattern: ^lts_[a-f0-9]+$
          description: Tier structure identifier
        created_at:
          type: string
          format: date-time
          description: Assignment creation timestamp
        object:
          type: string
          const: program_tier_structure
    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
  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'
    Conflict:
      description: Resource locked or invalid state transition
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 409
            key: non_draft_program
            message: Invalid vl_program status
            details: >-
              Cannot modify card definition assignment when program status is
              not DRAFT
    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

````