v1

latestOpenAPI 3.0.1MIT2026-07-263151,3912.3 MB
Templates

Add Promotion Tier From Template

Creates a promotion tier out of a discount campaign template and adds it to an existing promotion campaign.

To add a promotion tier to a campaign, you need to provide the name in the request and the campaign ID. Other fields are optional. If no other fields are sent, the configuration from the template will be used.

You can send new values of the fields listed below to replace the settings saved in the template. However, you cannot assign an action or an existing validation rule or create a new one in the request. If the template has a validation rule, a new validation rule is always created for the promotion tier. When the promotion tier has been created, then you can:

  • Update the validation rule,
  • Unassign the validation rule,
  • Assign an existing validation rule.

👍 Promotion Tiers and Campaign Templates

You can create a campaign template out of a promotion tier. Promotion tiers are converted to a discount campaign with the DISCOUNT_COUPON type. You can use this template to create:

  • Discount campaign
  • Promotion tier

📘 Campaign Templates – Documentation

Read the Campaign Templates documentation to learn more about this feature.

post/v1/templates/campaigns/{campaignTemplateId}/tier-setup

Request body

campaign_idstring required

Unique campaign identifier, assigned by Voucherify. Defines the promotion campaign to which the promotion tier will be added.

namestring required

Name of the promotion tier.

bannerstring

Text to be displayed to your customers on your website.

metadataobject

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.

hierarchyinteger

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.

activeboolean

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.

  • true indicates an active promotion tier
  • false indicates an inactive promotion tier
start_datestring date-time

Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is inactive before this date.

expiration_datestring date-time

Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is inactive after this date.

validity_day_of_weekinteger[]

Integer array corresponding to the particular days of the week in which the voucher is valid.

  • 0 Sunday
  • 1 Monday
  • 2 Tuesday
  • 3 Wednesday
  • 4 Thursday
  • 5 Friday
  • 6 Saturday
categorystring

Assign a new or update the promotion tier's category using name.

category_idstring

Assign a new or update the promotion tier's category using id

Example request

{
  "start_date": "2022-09-23T00:00:00.000Z",
  "expiration_date": "2022-09-26T00:00:00.000Z",
  "validity_timeframe": {
    "duration": "PT1H",
    "interval": "P2D"
  },
  "validity_hours": {
    "daily": [
      {
        "start_time": "12:00",
        "expiration_time": "14:00"
      }
    ]
  },
  "category": "cat_0c9da30e7116ba6bba",
  "category_id": "cat_0c9da30e7116ba6bba"
}

Response

Returns the details about the added promotion tier and about the resources that have been created out of the template and added to the project.

object'promotion_tier_setup' required

The type of the object represented by JSON. This object stores information about the campaign created out of the campaign template.

Example response

{
  "promotion_tier": {
    "id": "promo_63fYCt81Aw0h7lzyRkrGZh9p",
    "created_at": "2021-12-15T11:34:01.333Z",
    "updated_at": "2022-02-09T09:20:05.603Z",
    "campaign": {
      "start_date": "2022-09-22T00:00:00.000Z",
      "expiration_date": "2022-09-30T00:00:00.000Z",
      "validity_timeframe": {
        "duration": "PT1H",
        "interval": "P2D"
      },
      "validity_hours": {
        "daily": [
          {
            "start_time": "12:00",
            "expiration_time": "14:00"
          }
        ]
      },
      "category_id": "cat_0b688929a2476386a6"
    },
    "start_date": "2022-09-23T00:00:00.000Z",
    "expiration_date": "2022-09-26T00:00:00.000Z",
    "validity_timeframe": {
      "duration": "PT1H",
      "interval": "P2D"
    },
    "validity_hours": {
      "daily": [
        {
          "start_time": "12:00",
          "expiration_time": "14:00"
        }
      ]
    },
    "validation_rule_assignments": {
      "data": [
        {
          "id": "asgm_74F7QZoYbUoljwQO",
          "rule_id": "val_4j7DCRm2IS59",
          "related_object_id": "v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT",
          "created_at": "2022-02-17T08:18:15.085Z"
        }
      ]
    },
    "category_id": "cat_0c9da30e7116ba6bba",
    "categories": [
      {
        "created_at": "2022-07-14T10:45:13.156Z",
        "updated_at": "2022-08-16T10:52:08.094Z"
      }
    ]
  }
}