> ## 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.

# List Promotion Stacks

> This method enables you to list promotion stacks irrespective of the campaign they are associated with. 

You can use filters in the query parameters to specify the stacks to be returned in the response.

## Advanced filters for fetching promotion stacks

| **Filters** | **Examples** |
| :--- | :--- |
| Created Before | - `[created_at][before]=2021-12-30T13:52:18.227Z`<br />- `[filters][created_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |
| Created After | - `[created_at][after]=2021-12-30T13:52:18.227Z`<br />- `[filters][created_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |
| Updated Before | - `[updated_at][before]=2021-12-30T13:52:18.227Z`<br />- `[filters][updated_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |
| Updated After | - `[updated_at][after]=2021-12-30T13:52:18.227Z`<br />- `[filters][updated_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |



## OpenAPI

````yaml /openapi/promotions.json get /v1/promotions/stacks
openapi: 3.0.1
info:
  title: Voucherify API - Promotions
  version: v2018-08-01
  description: >-
    Voucherify promotion engine REST API. Please see
    https://docs.voucherify.io/docs for more details.
  contact:
    name: Voucherify Team
    url: https://www.voucherify.io/contact-support
    email: support@voucherify.io
  termsOfService: https://www.voucherify.io/legal/subscription-agreement
  license:
    name: MIT
    url: https://github.com/voucherifyio/voucherify-js-sdk/blob/main/LICENSE
servers:
  - url: https://{cluster}.voucherify.io
    description: Base URL
    variables:
      cluster:
        default: api
        enum:
          - api
          - us1.api
          - as1.api
          - download
          - us1.download
          - as1.download
security: []
paths:
  /v1/promotions/stacks:
    get:
      tags:
        - Promotions
      summary: List Promotion Stacks
      description: >-
        This method enables you to list promotion stacks irrespective of the
        campaign they are associated with. 


        You can use filters in the query parameters to specify the stacks to be
        returned in the response.


        ## Advanced filters for fetching promotion stacks


        | **Filters** | **Examples** |

        | :--- | :--- |

        | Created Before | - `[created_at][before]=2021-12-30T13:52:18.227Z`<br
        />-
        `[filters][created_at][conditions][$before][0]=2021-12-30T13:52:18.227Z`
        |

        | Created After | - `[created_at][after]=2021-12-30T13:52:18.227Z`<br
        />-
        `[filters][created_at][conditions][$after][0]=2021-12-30T13:52:18.227Z`
        |

        | Updated Before | - `[updated_at][before]=2021-12-30T13:52:18.227Z`<br
        />-
        `[filters][updated_at][conditions][$before][0]=2021-12-30T13:52:18.227Z`
        |

        | Updated After | - `[updated_at][after]=2021-12-30T13:52:18.227Z`<br
        />-
        `[filters][updated_at][conditions][$after][0]=2021-12-30T13:52:18.227Z`
        |
      operationId: list-all-promotion-stacks
      parameters:
        - schema:
            $ref: '#/components/schemas/ParameterLimit'
          in: query
          name: limit
          description: >-
            Limits the number of objects to be returned. The limit can range
            between 1 and 100 items.
        - schema:
            $ref: '#/components/schemas/ParameterPage'
          in: query
          description: Which page of results to return. The lowest value is `1`.
          name: page
        - schema:
            $ref: '#/components/schemas/ParameterOrderListAllPromotionStacks'
          in: query
          name: order
          description: >-
            Sorts the results using one of the filtering options, where the dash
            `-` preceding a sorting option means sorting in a descending order.
        - $ref: '#/components/parameters/created_at'
        - $ref: '#/components/parameters/updated_at'
      responses:
        '200':
          description: >-
            Returns a dictionary with a `data` property that contains an array
            of promotion stacks across all your campaigns.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromotionsStacksListResponseBody'
              examples:
                Example:
                  value:
                    object: list
                    data_ref: data
                    data:
                      - id: stack_SLuhQrAt3mXwHg776lYkzZO8
                        name: Stack 2
                        created_at: '2022-11-03T10:18:58.356Z'
                        campaign_id: camp_h8RyP6FV94F3Ev2odP24j5p1
                        object: promotion_stack
                        tiers:
                          ids:
                            - promo_Mfww2TuoeU23enqSmnz0f3rh
                            - promo_vU5IHaLKS7mmZ3ylABET6ikb
                            - promo_TeHA11JlfN29mUftDcpqIWWq
                            - promo_bhKBsIX3tO7yqmpTLCLLuaud
                          hierarchy_mode: MANUAL
                      - id: stack_twQWp1TyaxX5RlSqn061xGVy
                        name: First stack
                        created_at: '2021-12-27T11:59:21.838Z'
                        updated_at: '2022-12-16T08:22:51.970Z'
                        campaign_id: camp_HXsR22VUMC4hN4DR7eAhCalp
                        object: promotion_stack
                        tiers:
                          ids:
                            - promo_Vet0vCNyyo5pOddHfu2X3FCB
                            - promo_PoIyRVFA5c0Jk514xCpzKHga
                            - promo_Mwy9XpA0TLctSGriM5kum0qp
                          hierarchy_mode: MANUAL
                      - id: stack_vhCqN5PY7rmPw8yACRvHRZaz
                        name: Second stack
                        created_at: '2021-12-27T11:55:47.431Z'
                        updated_at: '2022-12-16T08:22:52.221Z'
                        campaign_id: camp_HXsR22VUMC4hN4DR7eAhCalp
                        object: promotion_stack
                        tiers:
                          ids:
                            - promo_Vet0vCNyyo5pOddHfu2X3FCB
                            - promo_PoIyRVFA5c0Jk514xCpzKHga
                            - promo_Mwy9XpA0TLctSGriM5kum0qp
                          hierarchy_mode: MANUAL
                      - id: stack_zwChew7GY1AnDZJQ6GVP2sdT
                        name: Third stack
                        created_at: '2021-12-27T11:54:26.283Z'
                        updated_at: '2022-12-16T08:22:52.483Z'
                        campaign_id: camp_HXsR22VUMC4hN4DR7eAhCalp
                        object: promotion_stack
                        tiers:
                          ids:
                            - promo_Vet0vCNyyo5pOddHfu2X3FCB
                            - promo_Mwy9XpA0TLctSGriM5kum0qp
                            - promo_PoIyRVFA5c0Jk514xCpzKHga
                          hierarchy_mode: MANUAL
                      - id: stack_NS5hEUznL9XPa89rbrOZYMey
                        name: Fourth stack
                        created_at: '2021-12-27T11:48:43.982Z'
                        campaign_id: camp_HXsR22VUMC4hN4DR7eAhCalp
                        object: promotion_stack
                        tiers:
                          ids:
                            - promo_Vet0vCNyyo5pOddHfu2X3FCB
                            - promo_Mwy9XpA0TLctSGriM5kum0qp
                            - promo_PoIyRVFA5c0Jk514xCpzKHga
                          hierarchy_mode: MANUAL
                      - id: stack_Rz0NvFtCZOObS3J5R68KET17
                        name: Third stack
                        created_at: '2021-12-27T11:40:57.426Z'
                        campaign_id: camp_HXsR22VUMC4hN4DR7eAhCalp
                        object: promotion_stack
                        tiers:
                          ids:
                            - promo_Vet0vCNyyo5pOddHfu2X3FCB
                            - promo_PoIyRVFA5c0Jk514xCpzKHga
                          hierarchy_mode: MANUAL
                      - id: stack_e8pH0nIuANmYRPE0x8hwDrpm
                        name: Second stack
                        created_at: '2021-12-27T08:43:13.875Z'
                        campaign_id: camp_HXsR22VUMC4hN4DR7eAhCalp
                        object: promotion_stack
                        tiers:
                          ids:
                            - promo_Mwy9XpA0TLctSGriM5kum0qp
                            - promo_PoIyRVFA5c0Jk514xCpzKHga
                          hierarchy_mode: MANUAL
                      - id: stack_3Q4EJpZqg3DI5IRwgBYfsb37
                        name: First stack
                        created_at: '2021-12-27T08:43:13.498Z'
                        campaign_id: camp_HXsR22VUMC4hN4DR7eAhCalp
                        object: promotion_stack
                        tiers:
                          ids:
                            - promo_Vet0vCNyyo5pOddHfu2X3FCB
                            - promo_PoIyRVFA5c0Jk514xCpzKHga
                          hierarchy_mode: MANUAL
                      - id: stack_KxSD0GahLUg9ULB6TseGfUHJ
                        name: Stack 1
                        created_at: '2021-12-23T12:28:38.881Z'
                        campaign_id: camp_h8RyP6FV94F3Ev2odP24j5p1
                        object: promotion_stack
                        tiers:
                          ids:
                            - promo_NMex647s5UushvbBUJmYT2Fc
                            - promo_4TqHr24boFISDrcOHSlfAxwm
                          hierarchy_mode: MANUAL
                    total: 9
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - promotions
components:
  schemas:
    ParameterLimit:
      type: integer
      minimum: 1
      maximum: 100
    ParameterPage:
      type: integer
      minimum: 1
      maximum: 100
    ParameterOrderListAllPromotionStacks:
      type: string
      enum:
        - created_at
        - '-created_at'
        - updated_at
        - '-updated_at'
        - name
        - '-name'
    PromotionsStacksListResponseBody:
      title: Promotions Stacks List Response Body
      description: >-
        Response body schema for **GET** `v1/promotions/stacks` and for **GET**
        `v1/promotions/{campaignId}/stacks`.
      type: object
      properties:
        object:
          type: string
          default: list
          enum:
            - list
          description: >-
            The type of the object represented by JSON. This object stores
            information about promotion stacks in a dictionary.
        data_ref:
          type: string
          default: data
          enum:
            - data
          description: >-
            Identifies the name of the attribute that contains the array of
            promotion stack objects.
        data:
          type: array
          description: Contains array of promotion stack objects.
          items:
            $ref: '#/components/schemas/PromotionStack'
        total:
          type: integer
          minimum: 0
          description: Total number of promotion stacks.
      required:
        - object
        - data_ref
        - data
        - total
    ParameterCreatedBeforeAfter:
      type: object
      properties:
        before:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time before the voucher was
            created. The value is shown in the ISO 8601 format.
          format: date-time
        after:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time after the voucher was
            created. The value is shown in the ISO 8601 format.
          format: date-time
    ParameterUpdatedBeforeAfter:
      type: object
      properties:
        before:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time before the voucher was
            updated. The value is shown in the ISO 8601 format.
          format: date-time
        after:
          type: string
          example: '2021-12-22T10:13:06.487Z'
          description: >-
            Timestamp representing the date and time after the voucher was
            updated. The value is shown in the ISO 8601 format.
          format: date-time
    PromotionStack:
      allOf:
        - $ref: '#/components/schemas/PromotionStackBase'
        - type: object
          properties:
            id:
              type: string
              description: Unique promotion stack ID.
            created_at:
              type: string
              format: date-time
              description: >-
                Timestamp representing the date and time when the promotion
                stack was created. The value is shown in the ISO 8601 format.
            updated_at:
              type: string
              format: date-time
              description: >-
                Timestamp representing the date and time when the promotion
                stack was updated. The value is shown in the ISO 8601 format.
            campaign_id:
              type: string
              description: Promotion stack's parent campaign's unique ID.
            object:
              type: string
              default: promotion_stack
              enum:
                - promotion_stack
              description: 'The type of the object represented by JSON. '
            category_id:
              type: string
              nullable: true
              description: Promotion stack category ID.
            categories:
              type: array
              description: Details about the category assigned to the promotion stack.
              items:
                $ref: '#/components/schemas/Category'
          required:
            - id
            - created_at
            - campaign_id
            - object
            - category_id
            - categories
    PromotionStackBase:
      title: Promotion Stack Base
      type: object
      properties:
        name:
          type: string
          description: Promotion stack name.
        tiers:
          type: object
          required:
            - ids
          description: >-
            Contains the tier configuration. A promotion stack can include up to
            30 tiers.
          properties:
            ids:
              type: array
              minItems: 1
              description: Contains the list of tiers in a pre-defined sequence.
              items:
                type: string
            hierarchy_mode:
              type: string
              default: MANUAL
              enum:
                - MANUAL
      required:
        - name
        - tiers
    Category:
      title: Category
      description: This is an object representing a category.
      type: object
      properties:
        id:
          type: string
          description: Unique category ID assigned by Voucherify.
        name:
          type: string
          description: Category name.
        hierarchy:
          type: integer
          description: >-
            Category hierarchy. Categories with lower hierarchy are processed
            before categories with higher hierarchy value.
          minimum: 0
        object:
          type: string
          default: category
          enum:
            - category
          description: >-
            The type of the object represented by the JSON. This object stores
            information about the category.
        created_at:
          type: string
          description: >-
            Timestamp representing the date and time when the category was
            created. The value is shown in the ISO 8601 format.
          example: '2022-07-14T10:45:13.156Z'
          format: date-time
        updated_at:
          type: string
          example: '2022-08-16T10:52:08.094Z'
          description: >-
            Timestamp representing the date and time when the category was
            updated. The value is shown in the ISO 8601 format.
          format: date-time
      required:
        - id
        - name
        - hierarchy
        - created_at
        - object
  parameters:
    created_at:
      name: created_at
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/ParameterCreatedBeforeAfter'
      description: >-
        A filter on the list based on the object `created_at` field. The value
        is a dictionary with the following options: `before`, `after`. A date
        value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or
        `2016-11-16`). An example:
        `[created_at][before]=2017-09-08T13:52:18.227Z`
      style: deepObject
      explode: true
    updated_at:
      name: updated_at
      in: query
      schema:
        $ref: '#/components/schemas/ParameterUpdatedBeforeAfter'
      description: >-
        A filter on the list based on the object `updated_at` field. The value
        is a dictionary with the following options: `before`, `after`. A date
        value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or
        `2016-11-16`). An example:
        `[updated_at][before]=2017-09-08T13:52:18.227Z`
      style: deepObject
      explode: true
  securitySchemes:
    X-App-Id:
      type: apiKey
      name: X-App-Id
      in: header
    X-App-Token:
      type: apiKey
      name: X-App-Token
      in: header
    X-Voucherify-OAuth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://api.voucherify.io/v1/oauth/token
          scopes:
            api: Gives access to whole server-side API.
            vouchers: >-
              Gives access to all endpoints and methods starting with
              `v1/vouchers`.
            client_api: Gives access to whole client-side API.
            client_vouchers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/vouchers`.
            promotions: >-
              Gives access to all endpoints and methods starting with
              `/v1/promotions`.
            client_promotions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/promotions`
            campaigns: >-
              Gives access to all endpoints and methods starting with
              `v1/campaigns`.
            client_publish: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/publish`.
            exports: >-
              Gives access to all endpoints and methods starting with
              `/v1/exports`.
            publications: >-
              Gives access to all endpoints and methods starting with
              `/v1/publications`.
            client_validate: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validate`.
            validations: >-
              Gives access to all endpoints and methods starting with
              `/v1/validations`.
            client_validations: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/validations`.
            qualifications: >-
              Gives access to all endpoints and methods starting with
              `/v1/qualifications`.
            client_qualifications: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/qualifications`.
            client_redeem: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redeem
            redemptions: >-
              Gives access to all endpoints and methods starting with
              `/v1/redemptions`.
            client_redemptions: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/redemptions`
            customers: >-
              Gives access to all endpoints and methods starting with
              `/v1/customers`.
            client_customers: >-
              Gives access to all endpoints and methods starting with
              `/client/v1/customers`.
            orders: >-
              Gives access to all endpoints and methods starting with
              `/v1/orders`.
            products: >-
              Gives access to all endpoints and methods starting with
              `/v1/products`.
            skus: >-
              Gives access to all endpoints and methods starting with
              `/v1/SKUs`.
            validation-rules: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules`.
            validation-rules-assignments: >-
              Gives access to all endpoints and methods starting with
              `/v1/validation-rules-assignments
            segments: >-
              Gives access to all endpoints and methods starting with
              `/v1/segments`.
            events: >-
              Gives access to all endpoints and methods starting with
              `/v1/events`.
            client_events: >-
              Gives access to all endpoints and methods starting with
              `client/v1/events`.
            rewards: >-
              Gives access to all endpoints and methods starting with
              `/v1/rewards`.
            assets: >-
              Gives access to all endpoints and methods starting with
              `/v1/assets`.
            task-results: >-
              Gives access to all endpoints and methods starting with
              `/v1/task-results`.
            loyalties: >-
              Gives access to all endpoints and methods starting with
              `/v1/loyalties`.
            client_consents: >-
              Gives access to all endpoints and methods starting with
              `client/v1/consents`.
            consents: >-
              Gives access to all endpoints and methods starting with
              `/v1/consents`.
            async-actions: >-
              Gives access to all endpoints and methods starting with
              `/v1/async-actions`.
            product-collections: >-
              Gives access to all endpoints and methods starting with
              `/v1/product-collections`.
            categories: >-
              Gives access to all endpoints and methods starting with
              `/v1/categories`.
            metadata-schemas: >-
              Gives access to all endpoints and methods starting with
              `/v1/metadata-schemas`.
            locations: >-
              Gives access to all endpoints and methods starting with
              `/v1/locations`.
            referrals: >-
              Gives access to all endpoints and methods starting with
              `/v1/referrals`.
            trash-bin: >-
              Gives access to all endpoints and methods starting with
              `/v1/trash-bin`.
            templates: >-
              Gives access to all endpoints and methods starting with
              `/v1/templates`.

````