Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
Specify the loyalty campaign details.
Request body schema for POST /loyalties
.
Base body schema for creating a campaign
Body schema for creating a campaign of loyalty type using POST v1/campaigns
.
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) voucherss.
AUTO_UPDATE
: the campaign is dynamic, i.e. vouchers will generate based on set criteriaSTATIC
: vouchers need to be manually published
AUTO_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
.
Integer array corresponding to the particular days of the week in which the voucher is valid.
0
Sunday1
Monday2
Tuesday3
Wednesday4
Thursday5
Friday6
Saturday
Determines the hours of validity, e.g. to create a happy hours scenario.
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.
Type of campaign.
LOYALTY_PROGRAM
Schema model for a discount voucher.
Response
Returns a campaign object with its settings but without the loyalty card codes.
Response body schema for POST /loyalties
.
Unique campaign ID, assigned by Voucherify.
"camp_f7fBbQxUuTN7dI7tGOo5XMDA"
Campaign name.
Type of campaign.
LOYALTY_PROGRAM
Defines whether the campaign can be updated with new vouchers after campaign creation.
AUTO_UPDATE
: the campaign is dynamic, i.e. vouchers will generate based on set criteriaSTATIC
: vouchers need to be manually published
AUTO_UPDATE
, STATIC
Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.
Always set to true
for loyalty campaigns, meaning customers can join the campaign only once. It can't be changed to false
.
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 category.
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.
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
.
Integer array corresponding to the particular days of the week in which the voucher is valid.
0
Sunday1
Monday2
Tuesday3
Wednesday4
Thursday5
Friday6
Saturday
Determines the hours of validity, e.g. to create a happy hours scenario.
Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a duration
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 campaign
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.
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.
Defines the Loyalty Tiers Expiration.
List of Validation Rules Assignments
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.