{
  "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"
          ]
        }
      }
    }
  ],
  "paths": {
    "/v1/promotions/tiers": {
      "get": {
        "operationId": "list-promotion-tiers",
        "tags": [
          "Promotions"
        ],
        "summary": "List Promotion Tiers",
        "description": "This method enables you to list promotion tiers.",
        "parameters": [
          {
            "schema": {
              "$ref": "#/components/schemas/ParameterBoolean"
            },
            "in": "query",
            "name": "is_available",
            "description": "This parameter allows filtering promotions that are only available at the moment. When set to `true`, it selects only non-expired and active promotions."
          },
          {
            "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/ParameterOrderListPromotionTiers"
            },
            "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."
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionsTiersListResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "object": "list",
                      "data_ref": "tiers",
                      "tiers": [
                        {
                          "id": "promo_NzjTc3ZXTe7md5SziK3uYtei",
                          "created_at": "2022-09-21T11:38:34.962Z",
                          "name": "Order more than $100",
                          "banner": "Order more than $100",
                          "action": {
                            "discount": {
                              "type": "AMOUNT",
                              "amount_off": 3000,
                              "effect": "APPLY_TO_ORDER"
                            }
                          },
                          "metadata": {},
                          "hierarchy": 1,
                          "promotion_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq",
                          "campaign": {
                            "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq",
                            "start_date": "2022-09-21T00:00:00.000Z",
                            "expiration_date": "2022-09-30T00:00:00.000Z",
                            "validity_timeframe": {
                              "interval": "P3D",
                              "duration": "P2D"
                            },
                            "validity_day_of_week": [
                              1,
                              2,
                              3,
                              4,
                              5
                            ],
                            "active": true,
                            "category_id": "cat_0bb81a481615a37b5e",
                            "object": "campaign"
                          },
                          "campaign_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq",
                          "active": true,
                          "start_date": "2022-09-21T00:00:00.000Z",
                          "expiration_date": "2022-09-30T00:00:00.000Z",
                          "validity_timeframe": {
                            "interval": "P3D",
                            "duration": "P2D"
                          },
                          "validity_day_of_week": [
                            1,
                            2
                          ],
                          "summary": {
                            "redemptions": {
                              "total_redeemed": 0
                            },
                            "orders": {
                              "total_amount": 0,
                              "total_discount_amount": 0
                            }
                          },
                          "object": "promotion_tier",
                          "validation_rule_assignments": null
                        },
                        {
                          "id": "promo_RaYHtUBre5jU8frUXOvYBtlN",
                          "created_at": "2021-12-15T11:34:01.358Z",
                          "updated_at": "2022-02-09T09:20:08.619Z",
                          "name": "Hot Promotion - Tier 2",
                          "banner": "Get Tier 2 Discount $20 Off",
                          "action": {
                            "discount": {
                              "type": "AMOUNT",
                              "amount_off": 2000,
                              "effect": "APPLY_TO_ORDER"
                            }
                          },
                          "metadata": {},
                          "hierarchy": 2,
                          "promotion_id": "camp_5h0wc453_5",
                          "campaign": {
                            "id": "camp_5h0wc453_5",
                            "start_date": null,
                            "expiration_date": null,
                            "active": true,
                            "category_id": "cat_0b688929a2476386a6",
                            "object": "campaign"
                          },
                          "campaign_id": "camp_5h0wc453_5",
                          "active": true,
                          "summary": {
                            "redemptions": {
                              "total_redeemed": 33
                            },
                            "orders": {
                              "total_amount": 519200,
                              "total_discount_amount": 66000
                            }
                          },
                          "object": "promotion_tier",
                          "validation_rule_assignments": {
                            "object": "list",
                            "data_ref": "data",
                            "data": [
                              {
                                "id": "asgm_pEe1inoYSfmO12p7",
                                "rule_id": "val_5h0wc453_5",
                                "related_object_id": "promo_RaYHtUBre5jU8frUXOvYBtlN",
                                "related_object_type": "promotion_tier",
                                "created_at": "2021-12-15T11:34:01.358Z",
                                "object": "validation_rules_assignment"
                              }
                            ],
                            "total": 1
                          }
                        },
                        {
                          "id": "promo_63fYCt81Aw0h7lzyRkrGZh9p",
                          "created_at": "2021-12-15T11:34:01.333Z",
                          "updated_at": "2022-02-09T09:20:05.603Z",
                          "name": "Hot Promotion - Tier 1",
                          "banner": "Get Tier 1 Discount 10zl",
                          "action": {
                            "discount": {
                              "type": "AMOUNT",
                              "amount_off": 1000,
                              "effect": "APPLY_TO_ORDER"
                            }
                          },
                          "metadata": {
                            "ProductionMetaData": "Hot Promotion - Tier 1"
                          },
                          "hierarchy": 1,
                          "promotion_id": "camp_5h0wc453_5",
                          "campaign": {
                            "id": "camp_5h0wc453_5",
                            "start_date": null,
                            "expiration_date": null,
                            "active": true,
                            "category_id": "cat_0b688929a2476386a6",
                            "object": "campaign"
                          },
                          "campaign_id": "camp_5h0wc453_5",
                          "active": true,
                          "summary": {
                            "redemptions": {
                              "total_redeemed": 11
                            },
                            "orders": {
                              "total_amount": 1414979,
                              "total_discount_amount": 11000
                            }
                          },
                          "object": "promotion_tier",
                          "validation_rule_assignments": {
                            "object": "list",
                            "data_ref": "data",
                            "data": [
                              {
                                "id": "asgm_QqYs7GGVy7cuh3L9",
                                "rule_id": "val_5h0wc453_4",
                                "related_object_id": "promo_63fYCt81Aw0h7lzyRkrGZh9p",
                                "related_object_type": "promotion_tier",
                                "created_at": "2021-12-15T11:34:01.333Z",
                                "object": "validation_rules_assignment"
                              }
                            ],
                            "total": 1
                          }
                        }
                      ],
                      "total": 3
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/promotions/{campaignId}/tiers": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCampaignId"
          },
          "name": "campaignId",
          "in": "path",
          "required": true,
          "description": "Unique campaign ID assigned by Voucherify."
        }
      ],
      "get": {
        "operationId": "list-promotion-tiers-from-campaign",
        "tags": [
          "Promotions"
        ],
        "summary": "List Promotion Tiers from Campaign",
        "description": "This method enables you to list promotion tiers from a specified campaign.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionsTiersListResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "object": "list",
                      "data_ref": "tiers",
                      "tiers": [
                        {
                          "id": "promo_xyOKjAmysZrwt3aqq1dMUwMU",
                          "created_at": "2022-04-07T08:43:53.730Z",
                          "updated_at": "2022-08-26T05:22:43.220Z",
                          "name": "Amount",
                          "banner": "Get $10 off entire order",
                          "action": {
                            "discount": {
                              "type": "AMOUNT",
                              "amount_off": 1000,
                              "effect": "APPLY_TO_ORDER"
                            }
                          },
                          "metadata": {},
                          "hierarchy": 2,
                          "promotion_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0",
                          "campaign": {
                            "id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0",
                            "start_date": null,
                            "expiration_date": null,
                            "active": true,
                            "category_id": "cat_0b5f67863083bf7c05",
                            "object": "campaign"
                          },
                          "campaign_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0",
                          "active": true,
                          "summary": {
                            "redemptions": {
                              "total_redeemed": 1
                            },
                            "orders": {
                              "total_amount": 2187,
                              "total_discount_amount": 1000
                            }
                          },
                          "object": "promotion_tier",
                          "validation_rule_assignments": null
                        },
                        {
                          "id": "promo_CQonGnrsFAdEJfJQ3oKB3a8G",
                          "created_at": "2022-04-07T08:43:53.581Z",
                          "updated_at": "2022-08-26T05:22:43.008Z",
                          "name": "Percentage",
                          "banner": "Get 10% OFF on entire order",
                          "action": {
                            "discount": {
                              "type": "PERCENT",
                              "percent_off": 10,
                              "effect": "APPLY_TO_ORDER"
                            }
                          },
                          "metadata": {},
                          "hierarchy": 1,
                          "promotion_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0",
                          "campaign": {
                            "id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0",
                            "start_date": null,
                            "expiration_date": null,
                            "active": true,
                            "category_id": "cat_0b5f67863083bf7c05",
                            "object": "campaign"
                          },
                          "campaign_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0",
                          "active": true,
                          "summary": {
                            "redemptions": {
                              "total_redeemed": 1
                            },
                            "orders": {
                              "total_amount": 71600,
                              "total_discount_amount": 7160
                            }
                          },
                          "object": "promotion_tier",
                          "validation_rule_assignments": null
                        }
                      ],
                      "total": 2,
                      "has_more": false
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "add-promotion-tier-to-campaign",
        "tags": [
          "Promotions"
        ],
        "summary": "Add Promotion Tier to Campaign",
        "description": "This method allows you to add a new promotion tier to an existing campaign. The tier hierarchy will be set as the next consequtive integer following the lowest ranking tier.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "requestBody": {
          "description": "Specify the promotion tier parameters.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromotionsTiersCreateRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "name": "Order more than $100",
                    "banner": "Order more than $100",
                    "action": {
                      "discount": {
                        "type": "AMOUNT",
                        "amount_off": 3000,
                        "effect": "APPLY_TO_ORDER"
                      }
                    },
                    "metadata": {},
                    "active": true,
                    "start_date": "2022-09-21T00:00:00.000Z",
                    "expiration_date": "2022-09-30T00:00:00.000Z",
                    "validity_timeframe": {
                      "interval": "P2D",
                      "duration": "P1D"
                    },
                    "validity_day_of_week": [
                      1,
                      2,
                      3,
                      4
                    ],
                    "validation_rules": [
                      "val_q8qUBMOh5qIQ"
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns a promotion tier object if the promotion tier was successfully added to the campaign.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionsTiersCreateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "promo_JcYGIKJsnv0SpZcx2njZm69x",
                      "created_at": "2022-09-22T11:21:57.808Z",
                      "name": "Order more than $100",
                      "banner": "Order more than $100",
                      "action": {
                        "discount": {
                          "type": "AMOUNT",
                          "amount_off": 3000,
                          "effect": "APPLY_TO_ORDER"
                        }
                      },
                      "metadata": {},
                      "hierarchy": 6,
                      "campaign": {
                        "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq",
                        "start_date": "2022-09-21T00:00:00.000Z",
                        "expiration_date": "2022-09-30T00:00:00.000Z",
                        "validity_day_of_week": [
                          1,
                          2,
                          3,
                          4,
                          5
                        ],
                        "active": true,
                        "object": "campaign"
                      },
                      "campaign_id": null,
                      "active": true,
                      "start_date": "2022-09-21T00:00:00.000Z",
                      "expiration_date": "2022-09-30T00:00:00.000Z",
                      "validity_timeframe": {
                        "interval": "P2D",
                        "duration": "P1D"
                      },
                      "validity_day_of_week": [
                        1,
                        2,
                        3,
                        4
                      ],
                      "summary": {
                        "redemptions": {
                          "total_redeemed": 0
                        },
                        "orders": {
                          "total_amount": 0,
                          "total_discount_amount": 0
                        }
                      },
                      "object": "promotion_tier",
                      "validation_rule_assignments": {
                        "object": "list",
                        "data_ref": "data",
                        "data": [
                          {
                            "id": "asgm_AmeYPmiLZKaIxq01",
                            "rule_id": "val_q8qUBMOh5qIQ",
                            "related_object_id": "promo_JcYGIKJsnv0SpZcx2njZm69x",
                            "related_object_type": "promotion_tier",
                            "created_at": "2022-09-22T11:21:57.808Z",
                            "object": "validation_rules_assignment"
                          }
                        ],
                        "total": 1
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/promotions/tiers/{promotionTierId}": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterPromotionTierId"
          },
          "name": "promotionTierId",
          "in": "path",
          "required": true,
          "description": "Unique promotion tier ID."
        }
      ],
      "get": {
        "operationId": "get-promotion-tier",
        "tags": [
          "Promotions"
        ],
        "summary": "Get Promotion Tier",
        "description": "This method enables you to retrieve a specific promotion tier.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a promotion tier object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionsTiersGetResponseBody"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "update-promotion-tier",
        "tags": [
          "Promotions"
        ],
        "summary": "Update Promotion Tier",
        "description": "This method updates a promotion tier.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "requestBody": {
          "description": "Specify the promotion tier parameters that you would like to update.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromotionsTiersUpdateRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "name": "Order more than $100 USD",
                    "banner": "Order more than $100 USD",
                    "action": {
                      "discount": {
                        "type": "PERCENT",
                        "percent_off": 25,
                        "effect": "APPLY_TO_ORDER"
                      }
                    },
                    "metadata": {
                      "level": "A-21"
                    },
                    "hierarchy": 1,
                    "start_date": "2022-09-22T00:00:00.000Z",
                    "expiration_date": "2022-09-29T00:00:00.000Z",
                    "validity_timeframe": {
                      "interval": "P3D",
                      "duration": "P2D"
                    },
                    "validity_day_of_week": [
                      1,
                      2,
                      3
                    ]
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns a promotion tier object if the update was successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionsTiersUpdateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "promo_hINAfBAVhmFuSAzi3vptfyxW",
                      "created_at": "2022-09-22T12:40:23.286Z",
                      "updated_at": "2022-09-22T12:40:58.626Z",
                      "name": "Order more than $100 USD",
                      "banner": "Order more than $100 USD",
                      "action": {
                        "discount": {
                          "type": "PERCENT",
                          "percent_off": 25,
                          "effect": "APPLY_TO_ORDER"
                        }
                      },
                      "metadata": {
                        "level": "A-21"
                      },
                      "hierarchy": 1,
                      "campaign": {
                        "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq",
                        "start_date": "2022-09-21T00:00:00.000Z",
                        "expiration_date": "2022-09-30T00:00:00.000Z",
                        "validity_day_of_week": [
                          1,
                          2,
                          3,
                          4,
                          5
                        ],
                        "active": true,
                        "object": "campaign"
                      },
                      "campaign_id": null,
                      "active": false,
                      "start_date": "2022-09-22T00:00:00.000Z",
                      "expiration_date": "2022-09-29T00:00:00.000Z",
                      "validity_timeframe": {
                        "interval": "P3D",
                        "duration": "P2D"
                      },
                      "validity_day_of_week": [
                        1,
                        2,
                        3
                      ],
                      "summary": {
                        "redemptions": {
                          "total_redeemed": 0
                        },
                        "orders": {
                          "total_amount": 0,
                          "total_discount_amount": 0
                        }
                      },
                      "object": "promotion_tier",
                      "validation_rule_assignments": {
                        "object": "list",
                        "data_ref": "data",
                        "data": [
                          {
                            "id": "asgm_8e3e53ZgDNcoRGAI",
                            "rule_id": "val_q8qUBMOh5qIQ",
                            "related_object_id": "promo_hINAfBAVhmFuSAzi3vptfyxW",
                            "related_object_type": "promotion_tier",
                            "created_at": "2022-09-22T12:40:23.286Z",
                            "object": "validation_rules_assignment"
                          }
                        ],
                        "total": 1
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete-promotion-tier",
        "tags": [
          "Promotions"
        ],
        "summary": "Delete Promotion Tier",
        "description": "This method deletes a promotion tier.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "responses": {
          "204": {
            "description": "Returns no content if deletion is successful."
          },
          "404": {
            "description": "Returns an error indicating that the promotion tier with given ID was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find promotion_tier with id promo_2EnAik6Jt7dKTOMkRTIgEjZ",
                      "request_id": "v-0ae284707e9027a79d",
                      "resource_id": "promo_2EnAik6Jt7dKTOMkRTIgEjZ",
                      "resource_type": "promotion_tier"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/promotions/tiers/{promotionTierId}/enable": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterPromotionTierId"
          },
          "name": "promotionTierId",
          "in": "path",
          "required": true,
          "description": "Unique promotion tier ID."
        }
      ],
      "post": {
        "operationId": "enable-promotion-tier",
        "tags": [
          "Promotions"
        ],
        "summary": "Enable Promotion Tier",
        "description": "This method enables a promotion tier, i.e. makes the `active` parameter = `true`.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the promotion tier object with an updated `active` parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionsTiersEnableResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "promo_NzjTc3ZXTe7md5SziK3uYtei",
                      "created_at": "2022-09-21T11:38:34.962Z",
                      "updated_at": "2022-09-22T10:32:07.712Z",
                      "name": "Order more than $100",
                      "banner": "Order more than $100",
                      "action": {
                        "discount": {
                          "type": "AMOUNT",
                          "amount_off": 3000,
                          "effect": "APPLY_TO_ORDER"
                        }
                      },
                      "metadata": {},
                      "hierarchy": 1,
                      "campaign": {
                        "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq",
                        "start_date": "2022-09-21T00:00:00.000Z",
                        "expiration_date": "2022-09-30T00:00:00.000Z",
                        "validity_day_of_week": [
                          1,
                          2,
                          3,
                          4,
                          5
                        ],
                        "active": true,
                        "object": "campaign"
                      },
                      "campaign_id": null,
                      "active": true,
                      "start_date": "2022-09-21T00:00:00.000Z",
                      "expiration_date": "2022-09-30T00:00:00.000Z",
                      "validity_day_of_week": [
                        1,
                        2,
                        3,
                        4,
                        5
                      ],
                      "summary": {
                        "redemptions": {
                          "total_redeemed": 2
                        },
                        "orders": {
                          "total_amount": 37650,
                          "total_discount_amount": 6000
                        }
                      },
                      "object": "promotion_tier",
                      "validation_rule_assignments": null
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error if the promotion tier cannot be found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find promotion_tier with id promo_NzjTc3ZXTe7md5SziK3uYte",
                      "request_id": "v-0bbaea52be14cc9782",
                      "resource_id": "promo_NzjTc3ZXTe7md5SziK3uYte",
                      "resource_type": "promotion_tier"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/promotions/tiers/{promotionTierId}/disable": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterPromotionTierId"
          },
          "name": "promotionTierId",
          "in": "path",
          "required": true,
          "description": "Unique promotion tier ID."
        }
      ],
      "post": {
        "operationId": "disable-promotion-tier",
        "tags": [
          "Promotions"
        ],
        "summary": "Disable Promotion Tier",
        "description": "This method disables a promotion tier, i.e. makes the `active` parameter = `false`.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the promotion tier object with an updated `active` parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionsTiersDisableResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "promo_NzjTc3ZXTe7md5SziK3uYtei",
                      "created_at": "2022-09-21T11:38:34.962Z",
                      "updated_at": "2022-09-22T10:34:09.529Z",
                      "name": "Order more than $100",
                      "banner": "Order more than $100",
                      "action": {
                        "discount": {
                          "type": "AMOUNT",
                          "amount_off": 3000,
                          "effect": "APPLY_TO_ORDER"
                        }
                      },
                      "metadata": {},
                      "hierarchy": 1,
                      "campaign": {
                        "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq",
                        "start_date": "2022-09-21T00:00:00.000Z",
                        "expiration_date": "2022-09-30T00:00:00.000Z",
                        "validity_day_of_week": [
                          1,
                          2,
                          3,
                          4,
                          5
                        ],
                        "active": true,
                        "object": "campaign"
                      },
                      "campaign_id": null,
                      "active": false,
                      "start_date": "2022-09-21T00:00:00.000Z",
                      "expiration_date": "2022-09-30T00:00:00.000Z",
                      "validity_day_of_week": [
                        1,
                        2,
                        3,
                        4,
                        5
                      ],
                      "summary": {
                        "redemptions": {
                          "total_redeemed": 2
                        },
                        "orders": {
                          "total_amount": 37650,
                          "total_discount_amount": 6000
                        }
                      },
                      "object": "promotion_tier",
                      "validation_rule_assignments": null
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error if the promotion tier cannot be found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find promotion_tier with id promo_NzjTc3ZXTe7md5SziK3uYte",
                      "request_id": "v-0bbaea52be14cc9782",
                      "resource_id": "promo_NzjTc3ZXTe7md5SziK3uYte",
                      "resource_type": "promotion_tier"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/promotions/stacks": {
      "get": {
        "operationId": "list-all-promotion-stacks",
        "tags": [
          "Promotions"
        ],
        "summary": "List Promotion Stacks",
        "description": "This method enables you to list promotion stacks irrespective of the campaign they are associated with. \n\nYou can use filters in the query parameters to specify the stacks to be returned in the response.\n\n## Advanced filters for fetching promotion stacks\n\n| **Filters** | **Examples** |\n| :--- | :--- |\n| Created Before | - `[created_at][before]=2021-12-30T13:52:18.227Z`<br />- `[filters][created_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |\n| Created After | - `[created_at][after]=2021-12-30T13:52:18.227Z`<br />- `[filters][created_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |\n| Updated Before | - `[updated_at][before]=2021-12-30T13:52:18.227Z`<br />- `[filters][updated_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |\n| Updated After | - `[updated_at][after]=2021-12-30T13:52:18.227Z`<br />- `[filters][updated_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |",
        "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"
          }
        ],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "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
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/promotions/{campaignId}/stacks": {
      "parameters": [
        {
          "schema": {
            "$ref": "#/components/schemas/ParameterCampaignId"
          },
          "name": "campaignId",
          "in": "path",
          "required": true,
          "description": "Unique campaign ID."
        }
      ],
      "get": {
        "operationId": "list-promotion-stacks-in-campaign",
        "tags": [
          "Promotions"
        ],
        "summary": "List Promotion Stacks in Campaign",
        "description": "This method enables you to list promotion stacks from a specified campaign.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a list of promotion stack objects.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionsStacksListResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "object": "list",
                      "data_ref": "data",
                      "data": [
                        {
                          "id": "stack_p0WhtyyDU95crobleMpRabhH",
                          "name": "First stack",
                          "created_at": "2022-09-22T13:03:25.740Z",
                          "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX",
                          "object": "promotion_stack",
                          "tiers": {
                            "ids": [
                              "promo_dJNhAEeV5sR5oPQq1UrUdnMC",
                              "promo_aaAF8mVAzA0PF1igia2OC63d"
                            ],
                            "hierarchy_mode": "MANUAL"
                          }
                        },
                        {
                          "id": "stack_XAzn8AFR3Ks3DBPLAQxV7zHe",
                          "name": "Second stack",
                          "created_at": "2022-09-22T13:03:25.903Z",
                          "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX",
                          "object": "promotion_stack",
                          "tiers": {
                            "ids": [
                              "promo_aaAF8mVAzA0PF1igia2OC63d",
                              "promo_dJNhAEeV5sR5oPQq1UrUdnMC"
                            ],
                            "hierarchy_mode": "MANUAL"
                          }
                        }
                      ],
                      "total": 2
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "create-promotion-stack",
        "tags": [
          "Promotions"
        ],
        "summary": "Create Promotion Stack",
        "description": "This method creates one promotion stack. The sequence of promotion tier IDs will determine the promotion stacking order.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "requestBody": {
          "description": "Specify the order of promotion tiers for the promotion stack.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromotionsStacksCreateRequestBody"
              },
              "examples": {
                "Example": {
                  "value": {
                    "name": "Fifth Stack",
                    "tiers": {
                      "ids": [
                        "promo_aaAF8mVAzA0PF1igia2OC63d",
                        "promo_t9zdL6XMFk7B8fQ23zxELtdE",
                        "promo_dJNhAEeV5sR5oPQq1UrUdnMC"
                      ],
                      "hierarchy_mode": "MANUAL"
                    }
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns a new stack object if a valid promotion campaign identifier was provided in the path and available promotion IDs in the payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionsStacksCreateResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "stack_q2AmzFvOMCmg4Wdu5bDBlME6",
                      "name": "Fifth Stack",
                      "created_at": "2022-09-23T07:44:53.888Z",
                      "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX",
                      "object": "promotion_stack",
                      "tiers": {
                        "ids": [
                          "promo_aaAF8mVAzA0PF1igia2OC63d",
                          "promo_t9zdL6XMFk7B8fQ23zxELtdE",
                          "promo_dJNhAEeV5sR5oPQq1UrUdnMC"
                        ],
                        "hierarchy_mode": "MANUAL"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error if the campaign or promotion tier cannot be found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Campaign Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find campaign with id camp_99HUWI53bVyLzPN1Fg5TBLW",
                      "request_id": "v-0bbc10de5886137afd",
                      "resource_id": "camp_99HUWI53bVyLzPN1Fg5TBLW",
                      "resource_type": "campaign"
                    }
                  },
                  "Promotion Tier Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find promotion_tier with id promo_dJNhAEeV5sR5oPQq1UrUdnM",
                      "request_id": "v-0bbc11186303fa288a",
                      "resource_id": "promo_dJNhAEeV5sR5oPQq1UrUdnM",
                      "resource_type": "promotion_tier"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/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."
        }
      ],
      "get": {
        "operationId": "get-promotion-stack",
        "tags": [
          "Promotions"
        ],
        "summary": "Get Promotion Stack",
        "description": "This method returns the details of a promotion stack, including the promotion tiers grouped within the stack.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Returns a stack object if valid identifiers were provided in the path.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromotionsStacksGetResponseBody"
                },
                "examples": {
                  "Example": {
                    "value": {
                      "id": "stack_p0WhtyyDU95crobleMpRabhH",
                      "name": "First stack",
                      "created_at": "2022-09-22T13:03:25.740Z",
                      "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX",
                      "object": "promotion_stack",
                      "tiers": {
                        "ids": [
                          "promo_dJNhAEeV5sR5oPQq1UrUdnMC",
                          "promo_aaAF8mVAzA0PF1igia2OC63d"
                        ],
                        "hierarchy_mode": "MANUAL"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Returns an error if the campaign or promotion stack cannot be found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Stack Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find promotion_stack with id stack_p0WhtyyDU95crobleMpRabh",
                      "request_id": "v-0bbc0a659591f99d65",
                      "resource_id": "stack_p0WhtyyDU95crobleMpRabh",
                      "resource_type": "promotion_stack"
                    }
                  },
                  "Campaign Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find campaign with id camp_99HUWI53bVyLzPN1Fg5TBLW",
                      "request_id": "v-0bbc0aa77a0c8b78e8",
                      "resource_id": "camp_99HUWI53bVyLzPN1Fg5TBLW",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "update-promotion-stack",
        "tags": [
          "Promotions"
        ],
        "summary": "Update Promotion Stack",
        "description": "This methods allows for editing an existing stack.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "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"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete-promotion-stack",
        "tags": [
          "Promotions"
        ],
        "summary": "Delete Promotion Stack",
        "description": "This method deletes a promotion stack.",
        "parameters": [],
        "security": [
          {
            "X-App-Id": [],
            "X-App-Token": []
          },
          {
            "X-Voucherify-OAuth": [
              "api",
              "promotions"
            ]
          }
        ],
        "responses": {
          "204": {
            "description": "Returns no content if deletion is successful."
          },
          "404": {
            "description": "Returns an error indicating that the stack or campaign with given ID was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "Stack Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find promotion_stack with id stack_KOIde7AUf08at12lZ1r3OfFp",
                      "request_id": "v-0ae289ca779027b030",
                      "resource_id": "stack_KOIde7AUf08at12lZ1r3OfFp",
                      "resource_type": "promotion_stack"
                    }
                  },
                  "Campaign Not Found": {
                    "value": {
                      "code": 404,
                      "key": "not_found",
                      "message": "Resource not found",
                      "details": "Cannot find campaign with id Summer % Promotion",
                      "request_id": "v-0ae28a621c46af534b",
                      "resource_id": "Summer % Promotion",
                      "resource_type": "campaign"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ParameterBoolean": {
        "type": "boolean"
      },
      "ParameterLimit": {
        "type": "integer",
        "maximum": 100,
        "minimum": 1
      },
      "ParameterPage": {
        "type": "integer",
        "minimum": 1,
        "maximum": 100
      },
      "ParameterOrderListPromotionTiers": {
        "type": "string",
        "enum": [
          "created_at",
          "-created_at",
          "updated_at",
          "-updated_at"
        ]
      },
      "PromotionsTiersListResponseBody": {
        "type": "object",
        "title": "Promotions Tiers List Response Body",
        "description": "Response body schema for **GET** `v1/promotions/{campaignId}/tiers` and **GET** `v1/promotions/tiers`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PromotionTiersList"
          }
        ]
      },
      "ParameterCampaignId": {
        "type": "string",
        "example": "camp_rRsfatlwN7unSeUIJDCYedal"
      },
      "PromotionsTiersCreateRequestBody": {
        "title": "Promotions Tiers Create Request Body",
        "description": "Request body schema for **POST** `v1/v1/promotions/{campaignId}/tiers`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PromotionTierCreate"
          }
        ]
      },
      "PromotionsTiersCreateResponseBody": {
        "title": "Promotions Tiers Create Response Body",
        "description": "Response body schema for **POST** `v1/promotions/{campaignId}/tiers`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PromotionTier"
          }
        ]
      },
      "PromotionsTiersGetResponseBody": {
        "type": "object",
        "title": "Promotions Tiers Get Response Body",
        "description": "Response body schema for **GET** `v1/promotions/tiers/{promotionTierId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PromotionTier"
          }
        ]
      },
      "ParameterPromotionTierId": {
        "type": "string",
        "example": "promo_2EnAik6Jt7dKTOMkRTIgEjZH"
      },
      "PromotionsTiersUpdateRequestBody": {
        "title": "Promotions Tiers Update Request Body",
        "description": "Request body schema for **PUT** `v1/promotions/tiers/{promotionTierId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PromotionTierUpdate"
          }
        ]
      },
      "PromotionsTiersUpdateResponseBody": {
        "title": "Promotions Tiers Update Response Body",
        "description": "Response body schema for **PUT** `v1/promotions/tiers/{promotionTierId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PromotionTier"
          }
        ]
      },
      "Error": {
        "title": "Error Object",
        "type": "object",
        "description": "Error details",
        "properties": {
          "code": {
            "type": "integer",
            "description": "Error's HTTP status code."
          },
          "key": {
            "type": "string",
            "description": "Short string describing the kind of error which occurred."
          },
          "message": {
            "type": "string",
            "description": "A human-readable message providing a short description of the error."
          },
          "details": {
            "type": "string",
            "description": "A human-readable message providing more details about the error."
          },
          "request_id": {
            "type": "string",
            "example": "v-0a885062c80375740f",
            "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team."
          },
          "resource_id": {
            "type": "string",
            "description": "Unique resource ID that can be used in another endpoint to get more details.",
            "example": "rf_0c5d710a87c8a31f86"
          },
          "resource_type": {
            "type": "string",
            "description": "The resource type.",
            "example": "voucher"
          },
          "error": {
            "type": "object",
            "description": "Includes additional information about the error.",
            "properties": {
              "message": {
                "type": "string",
                "description": "The message configured by the user in a validation rule."
              }
            }
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "PromotionsTiersEnableResponseBody": {
        "type": "object",
        "title": "Promotions Tiers Enable Response Body",
        "description": "Response body schema for **POST** `v1/promotions/tiers/{promotionTierId}/enable`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PromotionTier"
          }
        ]
      },
      "PromotionsTiersDisableResponseBody": {
        "type": "object",
        "title": "Promotions Tiers Disable Response Body",
        "description": "Response body schema for **POST** `v1/promotions/tiers/{promotionTierId}/disable`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PromotionTier"
          }
        ]
      },
      "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"
        ]
      },
      "PromotionsStacksCreateRequestBody": {
        "title": "Promotions Stacks Create Request Body",
        "description": "Request body schema for **POST** `v1/promotions/{campaignId}/stacks`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PromotionStackBase"
          },
          {
            "type": "object",
            "properties": {
              "category_id": {
                "type": "string",
                "description": "Promotion stack category ID."
              }
            }
          }
        ]
      },
      "PromotionsStacksCreateResponseBody": {
        "title": "Promotions Stacks Create Response Body",
        "description": "Response body schema for **POST** `v1/promotions/{campaignId}/stacks`.",
        "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."
              },
              "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",
              "campaign_id",
              "object",
              "category_id",
              "categories"
            ]
          }
        ]
      },
      "PromotionsStacksGetResponseBody": {
        "type": "object",
        "title": "Promotions Stacks Get Response Body",
        "description": "Response body schema for **GET** `v1/promotions/{campaignId}/stacks/{stackId}`.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PromotionStack"
          }
        ]
      },
      "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"
            ]
          }
        ]
      },
      "PromotionTiersList": {
        "type": "object",
        "description": "Promotion Tiers",
        "title": "Promotion Tiers",
        "properties": {
          "object": {
            "type": "string",
            "default": "list",
            "description": "The type of the object represented by JSON. This object stores information about promotion tiers in a dictionary."
          },
          "data_ref": {
            "type": "string",
            "default": "tiers",
            "description": "Identifies the name of the attribute that contains the array of promotion tier objects."
          },
          "tiers": {
            "type": "array",
            "description": "Contains array of promotion tier objects.",
            "items": {
              "$ref": "#/components/schemas/PromotionTier"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of promotion tiers."
          },
          "has_more": {
            "type": "boolean",
            "description": "As query results are always limited (by the limit parameter), the `has_more` flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results."
          }
        }
      },
      "PromotionTierCreate": {
        "title": "Promotion Tier Create",
        "type": "object",
        "description": "This is an object representing a promotion tier. Promotion tiers are always assigned to a campaign and cannot be used standalone.",
        "allOf": [
          {
            "$ref": "#/components/schemas/PromotionTierCreateBase"
          },
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "object",
                "description": "Contains details about the discount applied by the promotion tier.",
                "properties": {
                  "discount": {
                    "$ref": "#/components/schemas/Discount"
                  }
                }
              },
              "validation_rule_assignments": {
                "$ref": "#/components/schemas/ValidationRuleAssignmentsList"
              }
            }
          }
        ]
      },
      "PromotionTier": {
        "type": "object",
        "description": "This is an object representing a promotion tier. Promotion tiers are always assigned to a campaign and cannot be used standalone.",
        "title": "Promotion Tier",
        "properties": {
          "id": {
            "type": "string",
            "example": "promo_63fYCt81Aw0h7lzyRkrGZh9p",
            "description": "Unique promotion tier ID."
          },
          "created_at": {
            "type": "string",
            "example": "2021-12-15T11:34:01.333Z",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the promotion tier was created. The value is shown in the ISO 8601 format."
          },
          "updated_at": {
            "type": "string",
            "example": "2022-02-09T09:20:05.603Z",
            "format": "date-time",
            "description": "Timestamp representing the date and time when the promotion tier was updated. The value is shown in the ISO 8601 format."
          },
          "name": {
            "type": "string",
            "description": "Name of the promotion tier."
          },
          "banner": {
            "type": "string",
            "description": "Text to be displayed to your customers on your website."
          },
          "action": {
            "type": "object",
            "description": "Contains details about the discount applied by the promotion tier.",
            "properties": {
              "discount": {
                "$ref": "#/components/schemas/Discount"
              }
            }
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format."
          },
          "hierarchy": {
            "type": "integer",
            "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy."
          },
          "promotion_id": {
            "type": "string",
            "description": "Promotion unique ID."
          },
          "campaign": {
            "type": "object",
            "description": "Contains details about promotion tier's parent campaign.",
            "properties": {
              "id": {
                "type": "string",
                "description": "Unique campaign ID."
              },
              "start_date": {
                "type": "string",
                "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ",
                "format": "date-time",
                "example": "2022-09-22T00:00:00.000Z"
              },
              "expiration_date": {
                "type": "string",
                "format": "date-time",
                "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format.  Campaign is *inactive after* this date.",
                "example": "2022-09-30T00:00:00.000Z"
              },
              "validity_timeframe": {
                "$ref": "#/components/schemas/ValidityTimeframe"
              },
              "validity_day_of_week": {
                "$ref": "#/components/schemas/ValidityDayOfWeek"
              },
              "validity_hours": {
                "$ref": "#/components/schemas/ValidityHours"
              },
              "active": {
                "type": "boolean",
                "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date` using the [Disable Campaign](/api-reference/disable-campaign) endpoint.  \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign"
              },
              "category_id": {
                "type": "string",
                "example": "cat_0b688929a2476386a6",
                "description": "Unique category ID that this campaign belongs to."
              },
              "object": {
                "type": "string",
                "description": "The type of the object represented by the campaign object. This object stores information about the campaign.",
                "default": "campaign"
              }
            }
          },
          "campaign_id": {
            "type": "string",
            "description": "Promotion tier's parent campaign's unique ID."
          },
          "active": {
            "type": "boolean",
            "description": "A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the `start_date` and `expiration_date`.  \n\n- `true` indicates an *active* promotion tier\n- `false` indicates an *inactive* promotion tier"
          },
          "start_date": {
            "type": "string",
            "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ",
            "format": "date-time",
            "example": "2022-09-23T00:00:00.000Z"
          },
          "expiration_date": {
            "type": "string",
            "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ",
            "format": "date-time",
            "example": "2022-09-26T00:00:00.000Z"
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "summary": {
            "type": "object",
            "description": "Contains statistics about promotion tier redemptions and orders.",
            "properties": {
              "redemptions": {
                "type": "object",
                "description": "Contains statistics about promotion tier redemptions.",
                "properties": {
                  "total_redeemed": {
                    "type": "integer",
                    "description": "Number of times the promotion tier was redeemed."
                  }
                }
              },
              "orders": {
                "type": "object",
                "description": "Contains statistics about orders related to the promotion tier.",
                "properties": {
                  "total_amount": {
                    "type": "integer",
                    "description": "Sum of order totals."
                  },
                  "total_discount_amount": {
                    "type": "integer",
                    "description": "Sum of total discount applied using the promotion tier."
                  }
                }
              }
            }
          },
          "object": {
            "type": "string",
            "default": "promotion_tier",
            "description": "The type of the object represented by JSON. This object stores information about the promotion tier."
          },
          "validation_rule_assignments": {
            "$ref": "#/components/schemas/ValidationRuleAssignmentsList"
          },
          "category_id": {
            "type": "string",
            "description": "Promotion tier category ID.",
            "example": "cat_0c9da30e7116ba6bba"
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          }
        }
      },
      "PromotionTierUpdate": {
        "type": "object",
        "description": "This is an object representing a promotion tier. Promotion tiers are always assigned to a campaign and cannot be used standalone.",
        "title": "Promotion Tier Update",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the promotion tier."
          },
          "banner": {
            "type": "string",
            "description": "Text to be displayed to your customers on your website."
          },
          "action": {
            "type": "object",
            "description": "Contains details about the discount applied by the promotion tier.",
            "properties": {
              "discount": {
                "$ref": "#/components/schemas/Discount"
              }
            }
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format."
          },
          "hierarchy": {
            "type": "integer",
            "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy."
          },
          "start_date": {
            "type": "string",
            "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ",
            "format": "date-time",
            "example": "2022-09-23T00:00:00.000Z"
          },
          "expiration_date": {
            "type": "string",
            "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ",
            "format": "date-time",
            "example": "2022-09-26T00:00:00.000Z"
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "validation_rule_assignments": {
            "$ref": "#/components/schemas/ValidationRuleAssignmentsList"
          },
          "category": {
            "type": "string",
            "description": "Assign a new or update the promotion tier's category using name.",
            "example": "cat_0c9da30e7116ba6bba"
          },
          "category_id": {
            "type": "string",
            "description": "Assign a new or update the promotion tier's category using id",
            "example": "cat_0c9da30e7116ba6bba"
          }
        }
      },
      "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"
        ]
      },
      "PromotionTierCreateBase": {
        "title": "Promotion Tier Create Base",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the promotion tier."
          },
          "banner": {
            "type": "string",
            "description": "Text to be displayed to your customers on your website."
          },
          "metadata": {
            "type": "object",
            "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format."
          },
          "hierarchy": {
            "type": "integer",
            "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy."
          },
          "active": {
            "type": "boolean",
            "description": "A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the `start_date` and `expiration_date`.  \n\n- `true` indicates an *active* promotion tier\n- `false` indicates an *inactive* promotion tier"
          },
          "start_date": {
            "type": "string",
            "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ",
            "format": "date-time",
            "example": "2022-09-23T00:00:00.000Z"
          },
          "expiration_date": {
            "type": "string",
            "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ",
            "format": "date-time",
            "example": "2022-09-26T00:00:00.000Z"
          },
          "validity_timeframe": {
            "$ref": "#/components/schemas/ValidityTimeframe"
          },
          "validity_day_of_week": {
            "$ref": "#/components/schemas/ValidityDayOfWeek"
          },
          "validity_hours": {
            "$ref": "#/components/schemas/ValidityHours"
          },
          "category": {
            "type": "string",
            "description": "Assign a new or update the promotion tier's category using name.",
            "example": "cat_0c9da30e7116ba6bba"
          },
          "category_id": {
            "type": "string",
            "description": "Assign a new or update the promotion tier's category using id",
            "example": "cat_0c9da30e7116ba6bba"
          }
        },
        "required": [
          "name"
        ]
      },
      "Discount": {
        "title": "Discount",
        "type": "object",
        "description": "Contains information about discount.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/DiscountAmount"
          },
          {
            "$ref": "#/components/schemas/DiscountUnit"
          },
          {
            "$ref": "#/components/schemas/DiscountUnitMultiple"
          },
          {
            "$ref": "#/components/schemas/DiscountPercent"
          },
          {
            "$ref": "#/components/schemas/DiscountFixed"
          }
        ]
      },
      "ValidationRuleAssignmentsList": {
        "type": "object",
        "description": "Validation Rule Assignments List",
        "title": "Validation Rule Assignments List",
        "properties": {
          "object": {
            "type": "string",
            "description": "The type of the object represented by JSON. This object stores information about validation rule assignments.",
            "default": "list"
          },
          "data_ref": {
            "type": "string",
            "description": "Identifies the name of the JSON property that contains the array of validation rule assignments.",
            "default": "data"
          },
          "data": {
            "type": "array",
            "description": "A dictionary that contains an array of validation rule assignments.",
            "items": {
              "$ref": "#/components/schemas/ValidationRuleAssignment"
            }
          },
          "total": {
            "type": "integer",
            "description": "Total number of validation rule assignments."
          }
        },
        "required": [
          "object",
          "data_ref",
          "data",
          "total"
        ]
      },
      "ValidityTimeframe": {
        "title": "Validity Timeframe",
        "type": "object",
        "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.",
        "properties": {
          "duration": {
            "type": "string",
            "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.",
            "example": "PT1H"
          },
          "interval": {
            "type": "string",
            "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.",
            "example": "P2D"
          }
        }
      },
      "ValidityDayOfWeek": {
        "title": "Validity Day Of Week",
        "type": "array",
        "description": "Integer array corresponding to the particular days of the week in which the voucher is valid.\n\n- `0` Sunday\n- `1` Monday\n- `2` Tuesday\n- `3` Wednesday\n- `4` Thursday\n- `5` Friday\n- `6` Saturday",
        "items": {
          "type": "integer",
          "enum": [
            0,
            1,
            2,
            3,
            4,
            5,
            6
          ]
        }
      },
      "ValidityHours": {
        "title": "Validity Hours",
        "type": "object",
        "description": "Determines the hours of validity, e.g. to create a happy hours scenario.",
        "properties": {
          "daily": {
            "type": "array",
            "description": "Defines the recurring period(s) when the resource is active. The periods should not overlap.",
            "items": {
              "type": "object",
              "description": "Defines the recurring period(s) when the resource will be active.",
              "properties": {
                "start_time": {
                  "type": "string",
                  "format": "time",
                  "description": "Defines the starting hour of validity in the HH:mm format. The resource is *inactive before* this time.",
                  "example": "12:00"
                },
                "days_of_week": {
                  "type": "array",
                  "description": "Integer array corresponding to the particular days of the week in which the resource is valid.\n\n- `0` Sunday\n- `1` Monday\n- `2` Tuesday\n- `3`  Wednesday\n- `4` Thursday\n- `5` Friday\n- `6` Saturday",
                  "items": {
                    "type": "integer",
                    "enum": [
                      0,
                      1,
                      2,
                      3,
                      4,
                      5,
                      6
                    ]
                  }
                },
                "expiration_time": {
                  "type": "string",
                  "format": "time",
                  "description": "Defines the ending hour of validity in the HH:mm format. The resource is *inactive after* this time.",
                  "example": "14:00"
                }
              }
            }
          }
        }
      },
      "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"
        ]
      },
      "DiscountAmount": {
        "type": "object",
        "title": "Amount",
        "properties": {
          "type": {
            "type": "string",
            "default": "AMOUNT",
            "enum": [
              "AMOUNT"
            ],
            "description": "Defines the type of the voucher."
          },
          "amount_off": {
            "type": "number",
            "description": "Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000."
          },
          "amount_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the discount."
          },
          "aggregated_amount_limit": {
            "type": "integer",
            "description": "Maximum discount amount per order."
          },
          "effect": {
            "description": "Defines how the discount is applied to the customer's order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountAmountVouchersEffectTypes"
              }
            ]
          },
          "is_dynamic": {
            "type": "boolean",
            "description": "Flag indicating whether the discount was calculated using a formula."
          }
        },
        "required": [
          "type",
          "amount_off"
        ]
      },
      "DiscountUnit": {
        "type": "object",
        "title": "Unit",
        "properties": {
          "type": {
            "type": "string",
            "default": "UNIT",
            "enum": [
              "UNIT"
            ],
            "description": "Discount type."
          },
          "unit_off": {
            "type": "integer",
            "description": "Number of units to be granted a full value discount."
          },
          "unit_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the number of units."
          },
          "effect": {
            "description": "Defines how the unit is added to the customer's order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountUnitVouchersEffectTypes"
              }
            ]
          },
          "unit_type": {
            "type": "string",
            "description": "The product deemed as free, chosen from product inventory (e.g. time, items)."
          },
          "product": {
            "description": "Contains information about the product.",
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleProductDiscountUnit"
              }
            ]
          },
          "sku": {
            "$ref": "#/components/schemas/SimpleSkuDiscountUnit"
          },
          "is_dynamic": {
            "type": "boolean",
            "description": "Flag indicating whether the discount was calculated using a formula."
          }
        },
        "required": [
          "type",
          "unit_type"
        ]
      },
      "DiscountUnitMultiple": {
        "type": "object",
        "title": "Unit Multiple",
        "properties": {
          "type": {
            "type": "string",
            "default": "UNIT",
            "enum": [
              "UNIT"
            ],
            "description": "Discount type."
          },
          "effect": {
            "type": "string",
            "default": "ADD_MANY_ITEMS",
            "enum": [
              "ADD_MANY_ITEMS"
            ],
            "description": "Defines how the discount is applied to the customer's order."
          },
          "units": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DiscountUnitMultipleOneUnit"
            }
          }
        },
        "required": [
          "type",
          "units"
        ]
      },
      "DiscountPercent": {
        "type": "object",
        "title": "Percent",
        "properties": {
          "type": {
            "type": "string",
            "default": "PERCENT",
            "enum": [
              "PERCENT"
            ],
            "description": "Defines the type of the voucher."
          },
          "percent_off": {
            "type": "number",
            "description": "The percent discount that the customer will receive."
          },
          "percent_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the discount."
          },
          "amount_limit": {
            "type": "number",
            "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600."
          },
          "aggregated_amount_limit": {
            "type": "integer",
            "description": "Maximum discount amount per order."
          },
          "effect": {
            "description": "Defines how the discount is applied to the customer's order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountPercentVouchersEffectTypes"
              }
            ]
          },
          "is_dynamic": {
            "type": "boolean",
            "description": "Flag indicating whether the discount was calculated using a formula."
          }
        },
        "required": [
          "type",
          "percent_off"
        ]
      },
      "DiscountFixed": {
        "title": "Fixed",
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "default": "FIXED",
            "enum": [
              "FIXED"
            ],
            "description": "Defines the type of the voucher."
          },
          "fixed_amount": {
            "type": "number",
            "description": "Sets a fixed value for an order total or the item price. The value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. If the fixed amount is calculated by the formula, i.e. the `fixed_amount_formula` parameter is present in the fixed amount definition, this value becomes the **fallback value**. As a result, if the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value."
          },
          "fixed_amount_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the discount."
          },
          "effect": {
            "description": "Defines how the discount is applied to the customer's order.",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountFixedVouchersEffectTypes"
              }
            ]
          },
          "is_dynamic": {
            "type": "boolean",
            "description": "Flag indicating whether the discount was calculated using a formula."
          }
        },
        "required": [
          "type",
          "fixed_amount"
        ]
      },
      "ValidationRuleAssignment": {
        "title": "Validation Rule Assignment",
        "type": "object",
        "description": "This is an object representing a validation rule assignment.",
        "properties": {
          "id": {
            "type": "string",
            "example": "asgm_74F7QZoYbUoljwQO",
            "description": "Validation rule assignment ID."
          },
          "rule_id": {
            "type": "string",
            "example": "val_4j7DCRm2IS59",
            "description": "Validation rule ID."
          },
          "related_object_id": {
            "type": "string",
            "example": "v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT",
            "description": "The resource ID to which the validation rule was assigned."
          },
          "related_object_type": {
            "type": "string",
            "description": "The type of resource to which the validation rule was assigned.",
            "enum": [
              "voucher",
              "campaign",
              "earning_rule",
              "reward_assignment",
              "promotion_tier",
              "distribution"
            ]
          },
          "created_at": {
            "type": "string",
            "example": "2022-02-17T08:18:15.085Z",
            "description": "Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.",
            "format": "date-time"
          },
          "object": {
            "type": "string",
            "default": "validation_rules_assignment",
            "description": "The type of the object represented by the ID.",
            "enum": [
              "validation_rules_assignment"
            ]
          }
        },
        "required": [
          "id",
          "rule_id",
          "related_object_id",
          "related_object_type",
          "created_at",
          "object"
        ]
      },
      "DiscountAmountVouchersEffectTypes": {
        "title": "Discount Amount Vouchers Effect Types",
        "enum": [
          "APPLY_TO_ORDER",
          "APPLY_TO_ITEMS",
          "APPLY_TO_ITEMS_PROPORTIONALLY",
          "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY",
          "APPLY_TO_ITEMS_BY_QUANTITY"
        ],
        "type": "string"
      },
      "DiscountUnitVouchersEffectTypes": {
        "title": "Discount Unit Vouchers Effect Types",
        "enum": [
          "ADD_MISSING_ITEMS",
          "ADD_NEW_ITEMS",
          "ADD_MANY_ITEMS",
          "ADD_SAME_ITEMS"
        ],
        "type": "string"
      },
      "SimpleProductDiscountUnit": {
        "type": "object",
        "title": "Simple Product Discount Unit",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique product ID, assigned by Voucherify."
          },
          "source_id": {
            "type": "string",
            "description": "Product's source ID."
          },
          "name": {
            "type": "string",
            "description": "Product name."
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "SimpleSkuDiscountUnit": {
        "type": "object",
        "title": "Simple Sku Discount Unit",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique SKU ID, assigned by Voucherify."
          },
          "source_id": {
            "type": "string",
            "description": "Product variant's source ID."
          },
          "name": {
            "type": "string",
            "description": "Sku name"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "DiscountUnitMultipleOneUnit": {
        "type": "object",
        "title": "One Unit",
        "properties": {
          "unit_off": {
            "type": "number",
            "description": "Number of units to be granted a full value discount."
          },
          "unit_off_formula": {
            "type": "string",
            "description": "Formula used to dynamically calculate the number of units."
          },
          "effect": {
            "type": "string",
            "enum": [
              "ADD_NEW_ITEMS",
              "ADD_MISSING_ITEMS"
            ],
            "description": "Defines how the unit is added to the customer's order.\n\n"
          },
          "unit_type": {
            "type": "string",
            "description": "The product deemed as free, chosen from product inventory (e.g. time, items)."
          },
          "product": {
            "description": "Contains information about the product.",
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleProductDiscountUnit"
              }
            ]
          },
          "sku": {
            "description": "Contains information about the sku.",
            "allOf": [
              {
                "$ref": "#/components/schemas/SimpleSkuDiscountUnit"
              }
            ]
          }
        },
        "required": [
          "effect",
          "unit_type"
        ]
      },
      "DiscountPercentVouchersEffectTypes": {
        "title": "Discount Percent Vouchers Effect Types",
        "enum": [
          "APPLY_TO_ORDER",
          "APPLY_TO_ITEMS"
        ],
        "type": "string"
      },
      "DiscountFixedVouchersEffectTypes": {
        "title": "Discount Fixed Vouchers Effect Types",
        "enum": [
          "APPLY_TO_ORDER",
          "APPLY_TO_ITEMS"
        ],
        "type": "string"
      }
    },
    "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`."
            }
          }
        }
      }
    }
  }
}