v1

latestOpenAPI 3.0.1MIT2026-07-263151,3912.3 MB
Templates

Create Campaign From Template

Creates a campaign out of a campaign template.

To create a campaign, you need to provide the name in the request, while 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 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 campaign. When the campaign 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}/campaign-setup

Request body

namestring required

Campaign name.

descriptionstring

An optional field to keep any extra textual information about the campaign such as a campaign description and details.

type'AUTO_UPDATE' | 'STATIC' | 'STANDALONE'

Defines whether the campaign can be updated with new vouchers after campaign creation or if the campaign consists of generic (standalone) vouchers.

  • AUTO_UPDATE: the campaign is dynamic, i.e. vouchers will generate based on set criteria
  • STATIC: vouchers need to be manually published
  • STANDALONE: the campaign is a generic (standalone) one with a single voucher for public use (only for discount and gift card campaigns)
join_onceboolean

If this value is set to true, customers will be able to join the campaign only once. For loyalty campaigns, it's forced to true, even if join_once: false is passed in the request.

auto_joinboolean

Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.

use_voucher_metadata_schemaboolean

Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema.

vouchers_countinteger

Total number of unique vouchers in campaign (size of campaign).

start_datestring date-time

Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is inactive before this date.

expiration_datestring date-time

Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign 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
activity_duration_after_publishingstring

Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days.

category_idstring

Unique category ID that this campaign belongs to. Either pass this parameter OR the category.

categorystring

The category assigned to the campaign. Either pass this parameter OR the category_id.

metadataobject

The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format.

Example request

{
  "start_date": "2022-09-20T00: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_0b688929a2476386a7"
}

Response

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

object'campaign_setup' required

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