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

# Update Promotion Stack

> This methods allows for editing an existing stack.



## OpenAPI

````yaml /openapi/promotions.json put /v1/promotions/{campaignId}/stacks/{stackId}
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/{campaignId}/stacks/{stackId}:
    parameters:
      - schema:
          $ref: '#/components/schemas/ParameterCampaignId'
        name: campaignId
        in: path
        required: true
        description: >-
          ID of the promotion campaign. You can either pass the campaign ID,
          which was assigned by Voucherify, or the `name` of the campaign as the
          path parameter value, e.g., `Loyalty Campaign`. 
      - schema:
          $ref: '#/components/schemas/ParameterPromotionStackId'
        name: stackId
        in: path
        required: true
        description: Promotion stack ID.
    put:
      tags:
        - Promotions
      summary: Update Promotion Stack
      description: This methods allows for editing an existing stack.
      operationId: update-promotion-stack
      parameters: []
      requestBody:
        description: Specify the promotion stack parameters that you would like to update.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PromotionsStacksUpdateRequestBody'
            examples:
              Example:
                value:
                  name: Fifth Stack Modified
                  tiers:
                    ids:
                      - promo_aaAF8mVAzA0PF1igia2OC63d
                      - promo_t9zdL6XMFk7B8fQ23zxELtdE
                    hierarchy_mode: MANUAL
        required: true
      responses:
        '200':
          description: >-
            Returns a promotion stack with updated parameters if the update was
            successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromotionsStacksUpdateResponseBody'
              examples:
                Example:
                  value:
                    id: stack_q2AmzFvOMCmg4Wdu5bDBlME6
                    name: Fifth Stack Modified
                    created_at: '2022-09-23T07:44:53.888Z'
                    updated_at: '2022-09-23T07:59:44.172Z'
                    campaign_id: camp_99HUWI53bVyLzPN1Fg5TBLWX
                    object: promotion_stack
                    tiers:
                      ids:
                        - promo_aaAF8mVAzA0PF1igia2OC63d
                        - promo_t9zdL6XMFk7B8fQ23zxELtdE
                      hierarchy_mode: MANUAL
      security:
        - X-App-Id: []
          X-App-Token: []
        - X-Voucherify-OAuth:
            - api
            - promotions
components:
  schemas:
    ParameterCampaignId:
      type: string
      example: camp_rRsfatlwN7unSeUIJDCYedal
    ParameterPromotionStackId:
      type: string
      example: stack_KOIde7AUf08at12lZ1r3OfFL
    PromotionsStacksUpdateRequestBody:
      description: >-
        Request Body schema for **PUT**
        `v1/promotions/{campaignId}/stacks/{stackId}`.
      title: Promotions Stacks Update Request Body
      type: object
      properties:
        name:
          type: string
          description: Promotion stack name.
        tiers:
          type: object
          description: >-
            Contains the tier configuration. A promotion stack can include up to
            30 tiers.
          properties:
            ids:
              type: array
              description: Contains the list of tiers in a pre-defined sequence.
              items:
                type: string
            hierarchy_mode:
              type: string
              default: MANUAL
              enum:
                - MANUAL
              description: >-
                Category hierarchy. Categories with lower hierarchy are
                processed before categories with higher hierarchy value.
        category_id:
          type: string
          description: Promotion stack category ID.
    PromotionsStacksUpdateResponseBody:
      title: Promotions Stacks Update Response Body
      description: >-
        Response body schema for **PUT**
        `v1/promotions/{campaignId}/stacks/{stackId}`.
      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/PromotionStackBase'
          required:
            - id
            - created_at
            - updated_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
  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`.

````