curl --request POST \
--url https://{cluster}.voucherify.io/v1/templates/campaigns/{campaignTemplateId}/campaign-setup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "Campaign-out-of-template",
"description": "Created out of a template",
"auto_join": true,
"join_once": true
}
'{
"created_resources": [
{
"id": "val_3LBFw25WTmAK",
"object": "validation_rules"
}
],
"campaign": {
"id": "camp_txDwyDPeLvBEq490bfV2nLwo",
"name": "Campaign-out-of-template",
"campaign_type": "DISCOUNT_COUPONS",
"type": "AUTO_UPDATE",
"is_referral_code": false,
"voucher": {
"type": "DISCOUNT_VOUCHER",
"discount": {
"type": "AMOUNT",
"amount_off": 2500,
"aggregated_amount_limit": 25000,
"units": null,
"effect": "APPLY_TO_ITEMS"
},
"gift": null,
"loyalty_card": null,
"redemption": {
"quantity": 4,
"redeemed_quantity": 0
},
"code_config": {
"pattern": "##",
"length": 2,
"charset": "xD",
"prefix": "U-",
"postfix": "-WOT"
}
},
"auto_join": true,
"join_once": true,
"use_voucher_metadata_schema": true,
"description": "Winter 2024-25",
"start_date": null,
"expiration_date": null,
"validity_timeframe": null,
"validity_hours": null,
"validity_day_of_week": null,
"activity_duration_after_publishing": null,
"vouchers_count_invalid": null,
"vouchers_count": 0,
"active": true,
"metadata": null,
"created_at": "2024-09-26T17:14:56.226Z",
"updated_at": null,
"category": null,
"creation_status": "DONE",
"protected": false,
"validation_rules_assignments": {
"data": [
{
"id": "asgm_BLgJYmo64rnAK5eB",
"rule_id": "val_3LBFw25WTmAK",
"related_object_id": "camp_txDwyDPeLvBEq490bfV2nLwo",
"related_object_type": "campaign",
"created_at": "2024-09-26T17:14:56.226Z",
"object": "validation_rules_assignment"
}
],
"total": 1
},
"object": "campaign",
"deleted": false,
"deleted_at": null,
"category_id": null,
"voucher_type": "DISCOUNT_VOUCHER",
"discount": {
"type": "AMOUNT",
"amount_off": 2500,
"aggregated_amount_limit": 25000,
"units": null,
"effect": "APPLY_TO_ITEMS"
},
"gift": null,
"loyalty_card": null,
"voucher_code_config": {
"pattern": "##",
"length": 2,
"charset": "xD",
"prefix": "Your-",
"postfix": "-Voucher"
},
"default_voucher_redemption": {
"quantity": 4
}
},
"object": "campaign_setup"
}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:
๐ 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_COUPONtype. You can use this template to create:
๐ Campaign Templates โ Documentation
Read the Campaign Templates documentation to learn more about this feature.
curl --request POST \
--url https://{cluster}.voucherify.io/v1/templates/campaigns/{campaignTemplateId}/campaign-setup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"name": "Campaign-out-of-template",
"description": "Created out of a template",
"auto_join": true,
"join_once": true
}
'{
"created_resources": [
{
"id": "val_3LBFw25WTmAK",
"object": "validation_rules"
}
],
"campaign": {
"id": "camp_txDwyDPeLvBEq490bfV2nLwo",
"name": "Campaign-out-of-template",
"campaign_type": "DISCOUNT_COUPONS",
"type": "AUTO_UPDATE",
"is_referral_code": false,
"voucher": {
"type": "DISCOUNT_VOUCHER",
"discount": {
"type": "AMOUNT",
"amount_off": 2500,
"aggregated_amount_limit": 25000,
"units": null,
"effect": "APPLY_TO_ITEMS"
},
"gift": null,
"loyalty_card": null,
"redemption": {
"quantity": 4,
"redeemed_quantity": 0
},
"code_config": {
"pattern": "##",
"length": 2,
"charset": "xD",
"prefix": "U-",
"postfix": "-WOT"
}
},
"auto_join": true,
"join_once": true,
"use_voucher_metadata_schema": true,
"description": "Winter 2024-25",
"start_date": null,
"expiration_date": null,
"validity_timeframe": null,
"validity_hours": null,
"validity_day_of_week": null,
"activity_duration_after_publishing": null,
"vouchers_count_invalid": null,
"vouchers_count": 0,
"active": true,
"metadata": null,
"created_at": "2024-09-26T17:14:56.226Z",
"updated_at": null,
"category": null,
"creation_status": "DONE",
"protected": false,
"validation_rules_assignments": {
"data": [
{
"id": "asgm_BLgJYmo64rnAK5eB",
"rule_id": "val_3LBFw25WTmAK",
"related_object_id": "camp_txDwyDPeLvBEq490bfV2nLwo",
"related_object_type": "campaign",
"created_at": "2024-09-26T17:14:56.226Z",
"object": "validation_rules_assignment"
}
],
"total": 1
},
"object": "campaign",
"deleted": false,
"deleted_at": null,
"category_id": null,
"voucher_type": "DISCOUNT_VOUCHER",
"discount": {
"type": "AMOUNT",
"amount_off": 2500,
"aggregated_amount_limit": 25000,
"units": null,
"effect": "APPLY_TO_ITEMS"
},
"gift": null,
"loyalty_card": null,
"voucher_code_config": {
"pattern": "##",
"length": 2,
"charset": "xD",
"prefix": "Your-",
"postfix": "-Voucher"
},
"default_voucher_redemption": {
"quantity": 4
}
},
"object": "campaign_setup"
}The access token received from the authorization server in the OAuth 2.0 flow.
Pass the campaign template ID that was assigned by Voucherify.
"camp_tpl_zLtn2H9fgcG3NwO7t4PAfHcq"
Only name is required. The rest of the fields will overwrite the template configuration.
Request body schema for POST /v1/templates/campaigns/{campaignTemplateId}/campaign-setup.
Base body schema for creating a campaign
Campaign name.
An optional field to keep any extra textual information about the campaign such as a campaign description and details.
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 criteriaSTATIC: vouchers need to be manually publishedAUTO_UPDATE, STATIC 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.
Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.
Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema.
Total number of unique vouchers in campaign (size of campaign).
Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is inactive before this date.
"2022-09-20T00:00:00.000Z"
Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is inactive after this date.
"2022-09-30T00:00:00.000Z"
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.
Show child attributes
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.
"PT1H"
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.
"P2D"
Integer array corresponding to the particular days of the week in which the voucher is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Determines the hours of validity, e.g. to create a happy hours scenario.
Show child attributes
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Show child attributes
Defines the starting hour of validity in the HH:mm format. The resource is inactive before this time.
"12:00"
Integer array corresponding to the particular days of the week in which the resource is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Defines the ending hour of validity in the HH:mm format. The resource is inactive after this time.
"14:00"
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.
Unique category ID that this campaign belongs to. Either pass this parameter OR the category.
"cat_0b688929a2476386a7"
The category assigned to the campaign. Either pass this parameter OR the category_id.
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.
Assigns or unassigns an area or store to the campaign.
NOTE: this object can be sent if the Areas and Stores enterprise feature is enabled. Contact Voucherify Sales to learn more.
Show child attributes
Assigns the campaign to an area or a store. Provide the area and/or store IDs in the respective arrays. If a campaign changes assignments between areas or stores, unassign it from the area. For example, if a campaign is assigned to Area-01, but it must be now assigned to Store-01 within this area, you have to unassign the campaign from Area-01 and assign to Store-01 only.
If you want to assign the campaign to stores only, you do not have to send the area ID.
Show child attributes
List all area IDs to which the campaign will be assigned.
List all store IDs to which the campaign will be assigned.
List all area IDs where the campaign is assigned to all stores in the area. This assignment is not equal to the assignment to all area_stores_ids listed separately.
Unassigns the campaign from an area or a store. Provide the area and/or store IDs in the respective arrays. If a campaign changes assignments between areas or stores, unassign it first. For example, if a campaign is assigned to Area-01, but it must be now assigned to Store-01 within this area, you have to unassign the campaign from Area-01 and assigned to Store-01 only.
If you want to assign the campaign to stores only, you do not have to send the area ID.
Show child attributes
List all area IDs from which the campaign will be unassigned.
List all store IDs from which the campaign will be unassigned.
List all area IDs where the campaign will be unassigned from all stores in the area. This unassignment is not equal to the unassignment from all area_stores_ids listed separately.
Show child attributes
Contains information about the config used for the voucher code. Defines the code's pattern (prefix, postfix, length, charset, etc).
Show child attributes
Number of characters in a generated code (excluding prefix and postfix).
Characters that can appear in the code.
Examples:
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789A text appended before the code.
A text appended after the code.
A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.
Internal value, does not change anything if provided.
Returns the details about the created campaign and about the resources that have been created out of the template and added to the project.
Response body schema for POST /v1/templates/campaigns/{campaignTemplateId}/campaign-setup.
Contains a list of resources that have been added to the project when the campaign has been created out of the template.
Details of the created campaign.
Show child attributes
Unique campaign ID, assigned by Voucherify.
"camp_f7fBbQxUuTN7dI7tGOo5XMDA"
Campaign name.
Type of campaign.
LOYALTY_PROGRAM, GIFT_VOUCHERS, DISCOUNT_COUPONS, PROMOTION, REFERRAL_PROGRAM 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 criteriaSTATIC: vouchers need to be manually publishedSTANDALONE: campaign for single vouchersAUTO_UPDATE, STATIC, STANDALONE Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.
If this value is set to true, customers will be able to join the campaign only once. It is always false for generic (standalone) vouchers campaigns and it cannot be changed in them. It is always true for loyalty campaigns and it cannot be changed in them.
Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema.
Timestamp representing the date and time when the campaign was created. The value is shown in the ISO 8601 format.
"2021-12-01T08:00:50.038Z"
Indicates the status of the campaign creation.
DONE, IN_PROGRESS, FAILED, DRAFT, MODIFYING Indicates the status of the campaign's voucher generation.
DONE, IN_PROGRESS, FAILED, DRAFT, MODIFYING Indicates whether the resource can be deleted.
Unique category ID that this campaign belongs to.
"cat_0b688929a2476386a7"
Contains details about the campaign category. For the GET List campaigns endpoint, this is returned only if the expand=category query parameter is passed in the request. Otherwise, it is returned as an empty array. For GET Campaign summary endpoint, it is always returned as an empty array.
Show child attributes
Unique category ID assigned by Voucherify.
Category name.
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
x >= 0The type of the object represented by the JSON. This object stores information about the category.
category Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
"2022-07-14T10:45:13.156Z"
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
"2022-08-16T10:52:08.094Z"
The type of the object represented by JSON. This object stores information about the campaign.
An optional field to keep any extra textual information about the campaign such as a campaign description and details.
Schema model for a campaign voucher.
Show child attributes
Type of voucher.
Contains information about the config used for the voucher code. Defines the code's pattern (prefix, postfix, length, charset, etc).
Show child attributes
Number of characters in a generated code (excluding prefix and postfix).
Characters that can appear in the code.
Examples:
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789A pattern for codes where hashes (#) will be replaced with random characters. Overrides length.
A text appended before the code.
A text appended after the code.
Internal value, does not change anything if provided.
Flag indicating whether this voucher is a referral code; true for campaign type REFERRAL_PROGRAM.
Defines the voucher discount type and details.
Show child attributes
Defines the type of the voucher.
AMOUNT 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.
Formula used to dynamically calculate the discount.
Maximum discount amount per order.
Defines how the discount is applied to the customer's order.
APPLY_TO_ORDER, APPLY_TO_ITEMS, APPLY_TO_ITEMS_PROPORTIONALLY, APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY, APPLY_TO_ITEMS_BY_QUANTITY Flag indicating whether the discount was calculated using a formula.
Defines the voucher gift details.
Show child attributes
Total gift card income over the lifetime of the card. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00.
Available funds. The value is multiplied by 100 to represent 2 decimal places. For example 10000 cents for $100.00. balance = amount - subtracted_amount - redemption.redeemed_amount.
Total amount of subtracted credits over the gift card lifetime.
Defines how the credits are applied to the customer's order.
APPLY_TO_ORDER, APPLY_TO_ITEMS Defines the voucher loyalty card details.
Show child attributes
The initial number of points to assign to the loyalty card. This is the current loyalty card score i.e. the number of loyalty points on the card.
Defines the loyalty point expiration rule. This expiration rule applies when there are no expiration_rules defined for an earning rule.
Show child attributes
Type of period. Can be set for MONTH or FIXED_DAY_OF_YEAR. MONTH requires the period_value field. FIXED_DAY_OF_YEAR requires the fixed_month and fixed_day fields.
FIXED_DAY_OF_YEAR, MONTH Value of the period. Required for the period_type: MONTH.
Type of rounding of the expiration period. Optional for the period_type: MONTH.
END_OF_MONTH, END_OF_QUARTER, END_OF_HALF_YEAR, END_OF_YEAR, PARTICULAR_MONTH Value of rounding of the expiration period. Required for the rounding_type.
Determines the month when the points expire; 1 is January, 2 is February, and so on. Required for the period_type: FIXED_DAY_OF_YEAR.
1 <= x <= 12Determines the day of the month when the points expire. Required for the period_type: FIXED_DAY_OF_YEAR.
1 <= x <= 31Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is inactive before this date.
"2022-09-20T00:00:00.000Z"
Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is inactive after this date.
"2022-09-30T00:00:00.000Z"
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.
Show child attributes
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.
"PT1H"
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.
"P2D"
Integer array corresponding to the particular days of the week in which the voucher is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Determines the hours of validity, e.g. to create a happy hours scenario.
Show child attributes
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Show child attributes
Defines the starting hour of validity in the HH:mm format. The resource is inactive before this time.
"12:00"
Integer array corresponding to the particular days of the week in which the resource is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Defines the ending hour of validity in the HH:mm format. The resource is inactive after this time.
"14:00"
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.
Show child attributes
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.
"PT1H"
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.
"P2D"
Integer array corresponding to the particular days of the week in which the voucher is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Determines the hours of validity, e.g. to create a happy hours scenario.
Show child attributes
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Show child attributes
Defines the starting hour of validity in the HH:mm format. The resource is inactive before this time.
"12:00"
Integer array corresponding to the particular days of the week in which the resource is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Defines the ending hour of validity in the HH:mm format. The resource is inactive after this time.
"14:00"
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.
Total number of unique vouchers in campaign.
Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is inactive before this date.
"2022-09-20T00:00:00.000Z"
Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is inactive after this date.
"2022-09-30T00:00:00.000Z"
A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the start_date and expiration_date.
true indicates an active campaignfalse indicates an inactive campaignThe 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.
Timestamp representing the date and time when the campaign was last updated in ISO 8601 format.
"2022-09-20T09:18:19.623Z"
Unique category name.
Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. It is also not returned for restricted users who use the GET Campaign summary endpoint.
Defines the referee reward and the way a referral is triggered. Context: REFERRAL_PROGRAM.
Show child attributes
Define how a referral is triggered.
redemption, custom_event Defines the referee reward.
Show child attributes
Details of the resource from which the reward originates.
Show child attributes
Unique ID of the reward source.
"camp_kdxp3vf1clQ9CFs1jpqv3tZe"
Name of the reward source.
Type of resource represented by the source of the reward.
CAMPAIGN Type of reward.
LOYALTY_CARD, GIFT_VOUCHER Define the number of points to add to a loyalty card or credits to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.
Defines the Loyalty Tiers Expiration.
Show child attributes
Tier qualification.
BALANCE: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier.
POINTS_IN_PERIOD: A customer qualifies for the tier only if the sum of the accumulated points in a defined time interval reaches the tier threshold.
BALANCE, POINTS_IN_PERIOD Defines the conditions for the start date of the tier.
Show child attributes
What triggers the tier to be valid for a customer.
IMMEDIATE: After reaching the minimum required points.
NEXT_PERIOD: When the next qualification period starts.
IMMEDIATE, NEXT_PERIOD Defines the conditions for the expiration date of a tier.
Show child attributes
What triggers the tier to expire for a customer.
END_OF_PERIOD: Expire tier at the end of the period.
END_OF_NEXT_PERIOD: Expire tier at the end of the next period.
BALANCE_DROP: Tier expires when the points balance drops below the required range of the tier.
CUSTOM: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier.
END_OF_PERIOD, END_OF_NEXT_PERIOD, BALANCE_DROP, CUSTOM Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of P3M will be valid for an additional duration of 3 months and a tier with a duration of P1D will be valid for an additional duration of 1 day.
Defines the rounding mechanism for tier expiration.
Show child attributes
This mechanism describes a custom rounding for the expiration date.
MONTH, QUARTER, HALF_YEAR, YEAR, CUSTOM This mechanism describes a rounding strategy for the expiration date.
START, END Defines the type of unit of time in which the rounding period is counted.
MONTH Value for the unit of time that the rounding applies to. Units for this parameter are defined by the rounding.unit parameter.
0: January1: February2: March3: April4: May5: June6: July7: August8: September9: October10: November11: DecemberCustomers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period.
| Period | Definition |
|---|---|
| Calendar Month | Points collected in one calendar month January, February, March, etc. |
| Calendar Quarter | Points collected in the quarter - January - March - April - June - July - September - October - December |
| Calendar Half-year | Points collected in the half-year - January - June - July - December |
| Calendar Year | Points collected in one calendar year January - December |
MONTH, QUARTER, HALF_YEAR, YEAR Lists all assignments of the campaign to areas and stores. For GET List Campaigns, this is returned if the expand=access_settings_assignments query parameter is passed in the request. This object is not returned for the GET Campaign summary endpoint.
NOTE: This object is returned only if the Areas and Stores enterprise feature is enabled. Contact Voucherify Sales to learn more.
Show child attributes
The type of the object represented by JSON. Default is list. This object stores information about campaign assignments to areas and stores
list Identifies the name of the attribute that contains the array of campaign assignments.
data Contains an array of campaign assignments.
Show child attributes
Unique identifier of the campaign assignment.
"arsca_0ef5ee192117ae2416"
Unique identifier of the area to which the campaign is assigned.
"ar_0ea6cd7b781b8f857f"
Date and time when the assignment was made. The value is shown in the ISO 8601 format.
"2024-06-25T19:04:16.260Z"
The type of the object represented by JSON. This object stores information about the campaign assignment to areas or stores.
area_store_campaign_assignment Determines if the campaign is assigned to all of the stores in the area, i.e. if an area ID is passed in the access_settings.assign.area_all_stores_ids in the request.
Unique identifier of the store to which the campaign is assigned.
"ars_0ec347e2016bed85f4"
Total number of areas and stores to which the campaign is assigned.
x >= 0Promotion Tiers
Show child attributes
The type of the object represented by JSON. This object stores information about promotion tiers in a dictionary.
Identifies the name of the attribute that contains the array of promotion tier objects.
Contains array of promotion tier objects.
Show child attributes
Unique promotion tier ID.
"promo_63fYCt81Aw0h7lzyRkrGZh9p"
Timestamp representing the date and time when the promotion tier was created. The value is shown in the ISO 8601 format.
"2021-12-15T11:34:01.333Z"
Timestamp representing the date and time when the promotion tier was updated. The value is shown in the ISO 8601 format.
"2022-02-09T09:20:05.603Z"
Name of the promotion tier.
Text to be displayed to your customers on your website.
Contains details about the discount applied by the promotion tier.
Show child attributes
Contains information about discount.
Show child attributes
Defines the type of the voucher.
AMOUNT 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.
Formula used to dynamically calculate the discount.
Maximum discount amount per order.
Defines how the discount is applied to the customer's order.
APPLY_TO_ORDER, APPLY_TO_ITEMS, APPLY_TO_ITEMS_PROPORTIONALLY, APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY, APPLY_TO_ITEMS_BY_QUANTITY Flag indicating whether the discount was calculated using a formula.
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.
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 unique ID.
Contains details about promotion tier's parent campaign.
Show child attributes
Unique campaign ID.
Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is inactive before this date.
"2022-09-22T00:00:00.000Z"
Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is inactive after this date.
"2022-09-30T00:00:00.000Z"
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.
Show child attributes
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.
"PT1H"
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.
"P2D"
Integer array corresponding to the particular days of the week in which the voucher is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Determines the hours of validity, e.g. to create a happy hours scenario.
Show child attributes
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Show child attributes
Defines the starting hour of validity in the HH:mm format. The resource is inactive before this time.
"12:00"
Integer array corresponding to the particular days of the week in which the resource is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Defines the ending hour of validity in the HH:mm format. The resource is inactive after this time.
"14:00"
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 endpoint.
true indicates an active campaignfalse indicates an inactive campaignUnique category ID that this campaign belongs to.
"cat_0b688929a2476386a6"
The type of the object represented by the campaign object. This object stores information about the campaign.
Promotion tier's parent campaign's unique ID.
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 tierfalse indicates an inactive promotion tierActivation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is inactive before this date.
"2022-09-23T00:00:00.000Z"
Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is inactive after this date.
"2022-09-26T00:00:00.000Z"
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.
Show child attributes
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.
"PT1H"
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.
"P2D"
Integer array corresponding to the particular days of the week in which the voucher is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Determines the hours of validity, e.g. to create a happy hours scenario.
Show child attributes
Defines the recurring period(s) when the resource is active. The periods should not overlap.
Show child attributes
Defines the starting hour of validity in the HH:mm format. The resource is inactive before this time.
"12:00"
Integer array corresponding to the particular days of the week in which the resource is valid.
0 Sunday1 Monday2 Tuesday3 Wednesday4 Thursday5 Friday6 Saturday0, 1, 2, 3, 4, 5, 6 Defines the ending hour of validity in the HH:mm format. The resource is inactive after this time.
"14:00"
Contains statistics about promotion tier redemptions and orders.
Show child attributes
The type of the object represented by JSON. This object stores information about the promotion tier.
Validation Rule Assignments List
Show child attributes
The type of the object represented by JSON. This object stores information about validation rule assignments.
Identifies the name of the JSON property that contains the array of validation rule assignments.
A dictionary that contains an array of validation rule assignments.
Show child attributes
Validation rule assignment ID.
"asgm_74F7QZoYbUoljwQO"
Validation rule ID.
"val_4j7DCRm2IS59"
The resource ID to which the validation rule was assigned.
"v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT"
The type of resource to which the validation rule was assigned.
voucher, campaign, earning_rule, reward_assignment, promotion_tier, distribution Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.
"2022-02-17T08:18:15.085Z"
The type of the object represented by the ID.
validation_rules_assignment Total number of validation rule assignments.
Promotion tier category ID.
"cat_0c9da30e7116ba6bba"
Show child attributes
Unique category ID assigned by Voucherify.
Category name.
Category hierarchy. Categories with lower hierarchy are processed before categories with higher hierarchy value.
x >= 0The type of the object represented by the JSON. This object stores information about the category.
category Timestamp representing the date and time when the category was created. The value is shown in the ISO 8601 format.
"2022-07-14T10:45:13.156Z"
Timestamp representing the date and time when the category was updated. The value is shown in the ISO 8601 format.
"2022-08-16T10:52:08.094Z"
Total number of promotion tiers.
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.
List of Validation Rules Assignments
Show child attributes
The type of the object represented by JSON. This object stores information about validation rules assignments.
list Identifies the name of the attribute that contains the array of validation rules assignments.
data Contains array of validation rules assignments.
Show child attributes
The unique identifier for a assignment
The unique identifier for a rule
The unique identifier for a related object
The type of related object
The type of the object represented by JSON.
validation_rules_assignment Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format.
"2022-03-09T11:19:04.819Z"
Timestamp representing the date and time when the object was last updated in ISO 8601 format.
"2022-03-09T11:19:04.819Z"
The validation status of the assignment
VALID, PARTIALLY_VALID, INVALID The list of omitted rules
Total number of validation rules assignments.
x >= 0The type of the object represented by JSON. This object stores information about the campaign created out of the campaign template.
campaign_setup Was this page helpful?