diff --git a/Changelog.md b/Changelog.md index 34e79d007..4906955b6 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,65 @@ # Changelog +## 20231123 - Campaigns API + +**Added schemas** +- CampaignResponse +- CampaignVoucher +- CodeConfig +- CodeConfigResponse +- CampaignsImportVoucherLoyaltyCard +- CampaignLoyaltyCardResponse +- CampaignLoyaltyCardResponse +- CampaignLoyaltyCardRequestBody +- LuckyDraw +- CampaignsCreateBase +- CampaignsUpdateBase +- CampaignsUpdateCouponCampaignBase +- CampaignsUpdateDiscountCouponsCampaign +- CampaignsUpdateGiftCampaign +- CampaignsUpdateReferralCampaign +- CampaignsUpdateLoyaltyCampaign +- CampaignsUpdateGiveawayCampaign +- CampaignsUpdatePromotionCampaign +- CampaignsCreateRequestBody +- CampaignsUpdateRequestBody +- CampaignsCreateDiscountCouponsCampaign +- CampaignsCreateReferralCampaign +- CampaignsCreateGiftCampaign +- CampaignsCreateLoyaltyCampaign +- CampaignsCreatePromotionCampaign +- CampaignsCreateGiveawayCampaign +- CampaignsCreateCampaignVoucherWithCodeRequestBody +- CampaignsCreateCampaignVoucherRequestBody +- CampaignsImportVoucherRequestBody +- CampaignsImportVoucherItem +- CampaignsListResponseBody +- DiscountCouponsCampaignVoucher +- ReferralCampaignVoucher +- GiveawayCampaignVoucher +- GiftCampaignVoucher +- LoyaltyCampaignVoucher +- PromotionTierCreateParams +- PromotionTiersList +- LoyaltyTiersExpirationAll + +**Deleted schemas** +- 2_obj_campaign_object +- 2_req_create_campaign +- 2_req_create_campaign_discount_voucher +- 2_req_create_campaign_loyalty +- 2_req_create_campaign_gift +- 2_req_create_campaign_referral +- 2_req_create_campaign_promotion +- 2_req_update_campaign +- 2_req_add_vouchers_to_campaign +- 2_req_import_vouchers_to_campaign +- 2_obj_import_vouchers_to_campaign_object +- 2_res_list_campaigns +- 3_res_list_promotion_tiers_from_campaign +- 20_obj_category_object +- e_409_duplicate_found + ## 20231117 - Quality Fixes **Changed schemas** diff --git a/README.md b/README.md index 8d21448f4..67bdd8400 100644 --- a/README.md +++ b/README.md @@ -13,4 +13,4 @@ Please refer to the following guides: - [Guides](https://docs.voucherify.io/docs) - [Recipes](https://docs.voucherify.io/recipes) - [API Reference](https://docs.voucherify.io/reference/introduction-1) -- [Support Documentation](https://support.voucherify.io/) \ No newline at end of file +- [Support Documentation](https://support.voucherify.io/) diff --git a/docs/reference-docs/CAMPAIGNS-API-Add-Vouchers-To-Campaign.md b/docs/reference-docs/CAMPAIGNS-API-Add-Vouchers-To-Campaign.md index ef0b21ec5..53dc5b3d3 100644 --- a/docs/reference-docs/CAMPAIGNS-API-Add-Vouchers-To-Campaign.md +++ b/docs/reference-docs/CAMPAIGNS-API-Add-Vouchers-To-Campaign.md @@ -1,5 +1,5 @@ --- -title: Add Vouchers to Campaign +title: Add Voucher to Campaign type: endpoint categorySlug: voucherify-api slug: add-vouchers-to-campaign diff --git a/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md b/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md index a8a07728c..936535fe9 100644 --- a/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md +++ b/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md @@ -8,7 +8,13 @@ hidden: false order: 1 --- -## Campaign Object +## Campaign Response +All of: + +1. [Campaign](#campaign) +2.
Attributes | Description |
---|---|
promotion | See: Promotion Tiers |
validation_rules_assignments | See: Validation Rules Assignments List |
Unique campaign ID, assigned by Voucherify.
**Example:**camp_f7fBbQxUuTN7dI7tGOo5XMDA
| @@ -16,7 +22,7 @@ order: 1 | description`string` |An optional field to keep any extra textual information about the campaign such as a campaign description and details.
| | campaign_type`string` |Type of campaign.
Available values: `LOYALTY_PROGRAM`, `GIFT_VOUCHERS`, `DISCOUNT_COUPONS`, `PROMOTION`, `REFERRAL_PROGRAM`, `LUCKY_DRAW` | | type`string` |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 publishedIndicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.
| | join_once`boolean` |If this value is set to true
, customers will be able to join the campaign only once.
Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema.
| @@ -32,126 +38,70 @@ order: 1 | updated_at`string` |Timestamp representing the date and time when the voucher was updated in ISO 8601 format.
**Example:**2022-09-20T09:18:19.623Z
| | category`string` |Unique category name.
| | creation_status`string` |Indicates the status of the campaign creation.
Available values: `DONE`, `IN_PROGRESS`, `FAILED`, `DRAFT`, `MODIFYING` | -| vouchers_generation_status`string` |Indicates the status of the campaign's vouchers.
Available values: `DONE`, `IN_PROGRESS`, `FAILED`, `DRAFT` | +| vouchers_generation_status`string` |Indicates the status of the campaign's vouchers.
Available values: `DONE`, `IN_PROGRESS`, `FAILED`, `DRAFT`, `MODIFYING` | | protected`boolean` |Indicates whether the resource can be deleted.
| -| category_id`string` |Unique category ID that this campaign belongs to.
**Example:**cat_0b688929a2476386a7
| -| categories | See: [Category Object](#category-object) | +| category_id`string,null` |Unique category ID that this campaign belongs to.
**Example:**cat_0b688929a2476386a7
| +| categories`array` |Contains details about the category.
Array of [Category](#category) | | object`string` |The type of object represented by JSON. This object stores information about the campaign.
| -| referral_program`object` |Defines the referee reward and the way a referral is triggered. Context: REFERRAL_PROGRAM
.
Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
conversion_event_typestring | How a referral is triggered. Available values:redemption , custom_event | ||||||||||||||||
custom_eventobject | Contains details about the custom event.
| ||||||||||||||||
referee_rewardobject | Defines the referee reward.
|
Defines the expiration mechanism for loyalty tiers.
Any of: [Balance](#balance), [Points in Period](#points-in-period) | +| referral_program | See: [Referral Program](#referral-program) | +| loyalty_tiers_expiration | See: [Loyalty Tiers Expiration](#loyalty-tiers-expiration) | -## Discount Voucher +## Promotion Tiers | Attributes | Description | |:-----|:--------| -| type`string` |Type of voucher.
| -| discount |Defines the voucher discount type and details.
One of: [Amount](#amount), [Percentage](#percentage), [Fixed](#fixed), [Unit, single item](#unit-single-item), [Unit, multiple items](#unit-multiple-items), [Shipping](#shipping) | -| redemption`object` |Defines the redemption limits on vouchers.
Attributes | Description |
---|---|
quantityinteger | How many times a voucher can be redeemed. A |
Defines code's pattern (prefix, suffix, length, charset, etc).
Attributes | Description |
---|---|
lengthstring | Number of characters in a generated code (excluding prefix and postfix). |
charsetstring | Characters that can appear in the code. Examples:
|
prefixstring | A text appended before the code. |
postfixstring | A text appended after the code. |
patternstring | A pattern for codes where hashes (#) will be replaced with random characters. Overrides |
Indicates whether the voucher is a referral code; this is true
for campaign type REFERRAL_PROGRAM
.
The type of object represented by JSON. This object stores information about promotion tiers in a dictionary.
| +| data_ref`string` |Identifies the name of the attribute that contains the array of promotion tier objects.
| +| tiers`array` |Contains array of promotion tier objects.
Array of [Promotion Tier](#promotion-tier) | +| total`integer` |Total number of promotion tiers.
| +| has_more`boolean` |As query results are always limited (by the limit parameter), the has_more
flag indicates whether there are more records for given filter parameters. This let's you know if you are able to run another request (with a different page or a different start date filter) to get more records returned in the results.
Type of voucher.
| -| gift`object` |Defines the gift card details.
Attributes | Description |
---|---|
amountinteger | Initial gift card income to be applied to the gift card at voucher generation. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000. |
effectstring | Defines how the credits are applied to the customer's order. Available values:APPLY_TO_ORDER , APPLY_TO_ITEMS |
Defines the redemption limits on vouchers.
Attributes | Description |
---|---|
quantityinteger | How many times a voucher can be redeemed. A |
Defines code's pattern (prefix, suffix, length, charset, etc).
Attributes | Description |
---|---|
lengthstring | Number of characters in a generated code (excluding prefix and postfix). |
charsetstring | Characters that can appear in the code. Examples:
|
prefixstring | A text appended before the code. |
postfixstring | A text appended after the code. |
patternstring | A pattern for codes where hashes (#) will be replaced with random characters. Overrides |
Indicates whether the voucher is a referral code; this is true
for campaign type REFERRAL_PROGRAM
.
The type of object represented by JSON. This object stores information about validation rules assignments.
Available values: `list` | +| data_ref`string` |Identifies the name of the attribute that contains the array of validation rules assignments.
Available values: `data` | +| data`array` |Contains array of validation rules assignments.
Array of [Business Validation Rule Assignment](#business-validation-rule-assignment) | +| total`integer` |Total number of validation rules assignments.
| -## Loyalty Card +## Campaign Discount Voucher | Attributes | Description | |:-----|:--------| | type`string` |Type of voucher.
| -| loyalty_card`object` |Defines the loyalty card details.
Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
pointsinteger | Initial loyalty card income in points to be applied to the loyalty card at voucher generation. | ||||||||
expiration_rulesobject | Defines point expiration rules.
|
Defines the redemption limits on vouchers.
Attributes | Description |
---|---|
quantityinteger | How many times a voucher can be redeemed. A |
Defines code's pattern (prefix, suffix, length, charset, etc).
Attributes | Description |
---|---|
lengthstring | Number of characters in a generated code (excluding prefix and postfix). |
charsetstring | Characters that can appear in the code. Examples:
|
prefixstring | A text appended before the code. |
postfixstring | A text appended after the code. |
patternstring | A pattern for codes where hashes (#) will be replaced with random characters. Overrides |
Defines the voucher discount type and details.
See: [Discount](#discount) | +| gift |Defines the voucher gift details.
See: [Gift](#gift) | +| loyalty_card |Defines the voucher loyalty card details.
See: [Campaign Loyalty Card](#campaign-loyalty-card) | +| redemption`object` |Defines the redemption limits on vouchers.
Attributes | Description |
---|---|
quantityinteger,null | How many times a voucher can be redeemed. A |
Indicates whether the voucher is a referral code; this is true
for campaign type REFERRAL_PROGRAM
.
Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is inactive before this date.
**Example:**2022-09-20T00:00:00.000Z
| +| expiration_date`string` |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`object` |Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.start_date
required when including the validity_timeframe
.
Attributes | Description |
---|---|
intervalstring | Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an |
durationstring | Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a |
Unique category ID assigned by Voucherify.
| | name`string` |Category name.
| | hierarchy`integer` |Category hierarchy.
| +| object`string` |The type of object represented by the JSON. This object stores information about the category.
Available values: `category` | | created_at`string` |Timestamp representing the date and time when the category was created in ISO 8601 format.
**Example:**2022-07-14T10:45:13.156Z
| | updated_at`string` |Timestamp representing the date and time when the category was updated in ISO 8601 format.
**Example:**2022-08-16T10:52:08.094Z
| -| object`string` |The type of object represented by the JSON. This object stores information about the category.
| - -## Promotion Tiers -| Attributes | Description | -|:-----|:--------| -| object`string` |The type of object represented by JSON. This object stores information about promotion tiers in a dictionary.
| -| data_ref`string` |Identifies the name of the attribute that contains the array of promotion tier objects.
| -| tiers`array` |Contains array of promotion tier objects.
Array of [Promotion Tier](#promotion-tier) | -| total`integer` |Total number of promotion tiers.
| -| has_more`boolean` |As query results are always limited (by the limit parameter), the has_more
flag indicates whether there are more records for given filter parameters. This let's you know if you are able to run another request (with a different page or a different start date filter) to get more records returned in the results.
The type of the stacking rule eligibility.
Available values: `JOINT`, `EXCLUSIVE` | -## Balance +## Referral Program | Attributes | Description | |:-----|:--------| -| qualification_type`string` |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.
Defines the conditions for the start date of the tier.
Attributes | Description |
---|---|
typestring | What triggers the tier to be valid for a customer. IMMEDIATE |
Defines the conditions for the expiration date of a tier.
Any of: [Balance Drop](#balance-drop), [Custom](#custom) | +| conversion_event_type`string` |Define how a referral is triggered.
Available values: `redemption`, `custom_event` | +| custom_event`object` |Contains details about the custom event.
Attributes | Description |
---|---|
idstring | Unique custom event ID. Example:ms_Ll9enAm2BCN0M1s4VxWobLFM |
namestring | Custom event name. |
Defines the referee reward.
Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
related_object_parentobject | Details of the resource from which the reward originates.
| ||||||||
typestring | Type of reward. Available values:DISCOUNT_VOUCHER , LOYALTY_CARD , GIFT_VOUCHER , LUCKY_DRAW_CODE | ||||||||
amountstring | Define the number of |
Tier qualification.
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.
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.
Customers 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 |
Defines the conditions for the start date of the tier.
Attributes | Description |
---|---|
typestring | What triggers the tier to be valid for a customer. IMMEDIATE , NEXT_PERIOD |
Defines the conditions for the expiration date of a tier.
Attributes | Description |
---|---|
typestring | What triggers the tier to expire for a customer. END_OF_PERIOD , END_OF_NEXT_PERIOD |
extendstring | 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 |
Applies an amount discount.
| -| amount_off`integer` |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. In case of the amount being calculated by the formula, i.e. the amount_off_formula
parameter is present in the amount definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the amount off.
100
| -| amount_off_formula`string` |Formula used to calculate the discount.
| -| aggregated_amount_limit`integer` |Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects:
APPLY_TO_ITEMS
(each item subtotal is discounted equally)APPLY_TO_ITEMS_BY_QUANTITY
(each unit of matched products has the same discount value)Defines how the discount is applied to the customer's order. The discount effects are defined as follows:
APPLY_TO_ORDER
(discount applies to the total order amount)APPLY_TO_ITEMS
(each item subtotal is discounted equally)APPLY_TO_ITEMS_PROPORTIONALLY
(split discount proportionally to amount)APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY
(split discount proportionally to quantity)APPLY_TO_ITEMS_BY_QUANTITY
(each unit of matched products has the same discount value)Applies a percentage discount.
| -| amount_limit`string` |Upper limit allowed to be applied as a discount per order line item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600.
| -| aggregated_amount_limit`integer` |Maximum discount amount per order. This value is definable for the APPLY_TO_ITEMS
discount effect. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600.
Percent taken off the subtotal amount. In case of the percent being calculated by the formula, i.e. the percent_off_formula
parameter is present in the percent definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the percent off.
Formula used to calculate the discount.
| -| effect`string` |Defines how the discount is applied to the customer's order.
Available values: `APPLY_TO_ORDER`, `APPLY_TO_ITEMS` | - -## Fixed -| Attributes | Description | -|:-----|:--------| -| type`string` |Sets a fixed total on cart or item(s) and then calculates the discount to apply.
| -| fixed_amount`integer` |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.
1000
| -| fixed_amount_formula`string` |Formula used to calculate the discounted price of an item or a new order total.
| -| effect`string` |Effect | Definition |
---|---|
APPLY_TO_ORDER | Sets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15. |
APPLY_TO_ITEMS | Sets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price. |
Applies a full value discount to item(s).
| -| unit_off`number` |Number of units to be granted a full value discount. In case of the unit being calculated by the formula, i.e. the unit_off_formula
parameter is present in the unit definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the unit value.
1
| -| unit_off_formula`string` |Formula used to calculate the number of units.
| -| unit_type`string` |The product deemed as free, chosen from the product inventory (e.g. time, items).
**Example:**prod_f1r5Tpr0DuC7
| -| effect`string` |Defines how the unit is added to the customer's order.
Available values: `ADD_NEW_ITEMS`, `ADD_MISSING_ITEMS` | - -## Unit, multiple items -| Attributes | Description | -|:-----|:--------| -| type`string` |Applies a full value discount to item(s).
| -| effect`string` |Defines the effect for adding multiple item types.
| -| units`array` |Array of objects defining items to be offered for free. Each item type can have a different discount effect assigned.
Array of:Attributes | Description |
---|---|
unit_offinteger | Number of units to be granted a full value discount. In case of the unit being calculated by the formula, i.e. the 1 |
unit_off_formulastring | Formula used to calculate the number of units. |
unit_typestring | The product deemed as free, chosen from the product inventory (e.g. time, items). Example:prod_f1r5Tpr0DuC7 |
effectstring | Defines how the unit is added to the customer's order. Available values:ADD_NEW_ITEMS , ADD_MISSING_ITEMS |
Applies a full value discount to item(s).
| -| unit_off`number` |Subtracts 1 shipping item from the subtotal.
| -| unit_type`string` |The shipping product deemed as free.
| -| effect`string` |Defines how the unit is added to the customer's order.
| +| expiration_date`object` |Defines the conditions for the expiration date of a tier.
Attributes | Description |
---|---|
typestring | What triggers the tier to expire for a customer. END_OF_PERIOD , END_OF_NEXT_PERIOD , BALANCE_DROP , CUSTOM |
extendstring | 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 |
rounding | Defines the rounding mechanism for tier expiration. |
Promotion tier category ID.
**Example:**cat_0c9da30e7116ba6bba
| | categories`array` | Array of [Category](#category) | -## Balance Drop +## Business Validation Rule Assignment | Attributes | Description | |:-----|:--------| -| type`string` |What triggers the tier to expire for a customer.BALANCE_DROP
: Tier expires when the points balance drops below the required range of the tier.
What triggers the tier to expire for a customer.CUSTOM
: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier.
Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months.
| -| rounding |Defines the rounding mechanism for tier expiration.
Any of: [Calendar Periods](#calendar-periods), [Specific Month](#specific-month) | +| id`string` |The unique identifier for a assignment
| +| rule_id`string` |The unique identifier for a rule
| +| related_object_id`string` |The unique identifier for a related object
| +| related_object_type`string` |The type of related object
| +| created_at`string` |Timestamp representing the date and time when the object was created in ISO 8601 format.
**Example:**2022-03-09T11:19:04.819Z
| +| updated_at`string` |Timestamp representing the date and time when the object was last updated in ISO 8601 format.
**Example:**2022-03-09T11:19:04.819Z
| +| object`string` |The type of object represented by JSON.
Available values: `validation_rules_assignment` | +| validation_status`string` |The validation status of the assignment
Available values: `VALID`, `PARTIALLY_VALID`, `INVALID` | +| validation_omitted_rules`array` |The list of omitted rules
| ## DiscountContains information about discount.
@@ -197,38 +148,31 @@ Any of: [Amount](#amount), [Unit](#unit), [Unit Multiple](#unit-multiple), [Percent](#percent), [Fixed](#fixed) -## Validation Rule Assignments +## Gift | Attributes | Description | |:-----|:--------| -| object`string` |The type of object represented by JSON. This object stores information about validation rule assignments.
| -| data_ref`string` |Identifies the name of the JSON property that contains the array of validation rule assignments.
| -| data`array` |A dictionary that contains an array of validation rule assignments.
Array of [Validation Rule Assignment](#validation-rule-assignment) | -| total`integer` |Total number of validation rule assignments.
| +| amount`number` |Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.
| +| balance`number` |Available funds. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000.
| +| effect`string` |Defines how the credits are applied to the customer's order.
Available values: `APPLY_TO_ORDER`, `APPLY_TO_ITEMS` | -## Category +## Campaign Loyalty Card | Attributes | Description | |:-----|:--------| -| id`string` |Unique category ID assigned by Voucherify.
| -| name`string` |Category name.
| -| hierarchy`integer` |Category hierarchy.
| -| object`string` |The type of object represented by the JSON. This object stores information about the category.
Available values: `category` | -| created_at`string` |Timestamp representing the date and time when the category was created in ISO 8601 format.
**Example:**2022-07-14T10:45:13.156Z
| -| updated_at`string` |Timestamp representing the date and time when the category was updated in ISO 8601 format.
**Example:**2022-08-16T10:52:08.094Z
| -| stacking_rules_type`string` |The type of the stacking rule eligibility.
Available values: `JOINT`, `EXCLUSIVE` | +| points`integer` |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.
| +| expiration_rules`object` |Attributes | Description |
---|---|
period_typestring | Type of period |
period_valueinteger | Value of the period |
rounding_typestring | Type of rounding |
rounding_valueinteger | Value of rounding |
Period to which the expiration will be rounded to.
MONTH
: The expiration date will be rounded to the end of the month.QUARTER
: The expiration date will be rounded to the end of the quarter.HALF_YEAR
: The expiration date will be rounded to the half year.YEAR
: The expiration date will be rounded to the end of the year.Which portion of the given period should the rounding be applied to.
Available values: `END` | +## Code Config Response +All of: -## Specific Month +1. [Code Config](#code-config) + +## Validation Rule Assignments | Attributes | Description | |:-----|:--------| -| type`string` |This mechanism describes a custom rounding for the expiration date.
Available values: `CUSTOM` | -| strategy`string` |Which portion of the given period should the rounding be applied to.
Available values: `END` | -| unit`string` |Defines the type of unit of time in which the rounding period is counted.
Available values: `MONTH` | -| value`integer` |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
: DecemberThe type of object represented by JSON. This object stores information about validation rule assignments.
| +| data_ref`string` |Identifies the name of the JSON property that contains the array of validation rule assignments.
| +| data`array` |A dictionary that contains an array of validation rule assignments.
Array of [Validation Rule Assignment](#validation-rule-assignment) | +| total`integer` |Total number of validation rule assignments.
| ## Amount | Attributes | Description | @@ -279,6 +223,16 @@ Any of: | effect |Defines how the discount is applied to the customer's order.
See: [Discount Fixed Vouchers Effect Types](#discount-fixed-vouchers-effect-types) | | is_dynamic`boolean` |Flag indicating whether the discount was calculated using a formula.
| +## Code Config +| Attributes | Description | +|:-----|:--------| +| length`string` |Number of characters in a generated code (excluding prefix and postfix).
| +| charset`string` |Characters that can appear in the code.
Examples:
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
A text appended before the code.
| +| postfix`string` |A text appended after the code.
| +| pattern`string` |A pattern for codes where hashes (#) will be replaced with random characters. Overrides length
.
The initial count
| + ## Validation Rule Assignment | Attributes | Description | |:-----|:--------| diff --git a/docs/reference-docs/CUSTOMERS-API-Customer-Activity-Object.md b/docs/reference-docs/CUSTOMERS-API-Customer-Activity-Object.md index 70e45e433..b3cdeebbc 100644 --- a/docs/reference-docs/CUSTOMERS-API-Customer-Activity-Object.md +++ b/docs/reference-docs/CUSTOMERS-API-Customer-Activity-Object.md @@ -816,7 +816,7 @@ All of: |:-----|:--------| | conversion_event_type`string` |Define how a referral is triggered.
Available values: `redemption`, `custom_event` | | custom_event`object` |Contains details about the custom event.
Attributes | Description |
---|---|
idstring | Unique custom event ID. Example:ms_Ll9enAm2BCN0M1s4VxWobLFM |
namestring | Custom event name. |
Defines the referee reward.
Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
related_object_parentobject | Details of the resource from which the reward originates.
| ||||||||
typestring | Type of reward. Available values:LOYALTY_CARD , GIFT_VOUCHER | ||||||||
amountstring | Define the number of |
Defines the referee reward.
Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
related_object_parentobject | Details of the resource from which the reward originates.
| ||||||||
typestring | Type of reward. Available values:DISCOUNT_VOUCHER , LOYALTY_CARD , GIFT_VOUCHER , LUCKY_DRAW_CODE | ||||||||
amountstring | Define the number of |
Indicates the status of the campaign's vouchers.
Available values: `DONE`, `IN_PROGRESS`, `FAILED`, `DRAFT` | | protected`boolean` |Indicates whether the resource can be deleted.
| | category_id`string` |Unique category ID that this campaign belongs to.
**Example:**cat_0b688929a2476386a7
| -| categories | See: [Category Object](#category-object) | +| categories | See: [Category](#category) | | loyalty_tiers_expiration`object` |Defines the expiration mechanism for loyalty tiers.
Any of: [Balance](#balance), [Points in Period](#points-in-period) | | object`string` |The type of object represented by JSON. This object stores information about the campaign.
| @@ -47,15 +47,16 @@ order: 1 | code_config`object` |Defines code's pattern (prefix, suffix, length, charset, etc).
Attributes | Description |
---|---|
lengthstring | Number of characters in a generated code (excluding prefix and postfix). |
charsetstring | Characters that can appear in the code. Examples:
|
prefixstring | A text appended before the code. |
postfixstring | A text appended after the code. |
patternstring | A pattern for codes where hashes (#) will be replaced with random characters. Overrides |
Indicates whether the voucher is a referral code; this is true
for campaign type REFERRAL_PROGRAM
.
Unique category ID assigned by Voucherify.
| | name`string` |Category name.
| | hierarchy`integer` |Category hierarchy.
| +| object`string` |The type of object represented by the JSON. This object stores information about the category.
Available values: `category` | | created_at`string` |Timestamp representing the date and time when the category was created in ISO 8601 format.
**Example:**2022-07-14T10:45:13.156Z
| | updated_at`string` |Timestamp representing the date and time when the category was updated in ISO 8601 format.
**Example:**2022-08-16T10:52:08.094Z
| -| object`string` |The type of object represented by the JSON. This object stores information about the category.
| +| stacking_rules_type`string` |The type of the stacking rule eligibility.
Available values: `JOINT`, `EXCLUSIVE` | ## Balance | Attributes | Description | diff --git a/docs/reference-docs/LOYALTIES-API-Loyalty-Card-Object.md b/docs/reference-docs/LOYALTIES-API-Loyalty-Card-Object.md index 37eae7f9b..32f1ca1e1 100644 --- a/docs/reference-docs/LOYALTIES-API-Loyalty-Card-Object.md +++ b/docs/reference-docs/LOYALTIES-API-Loyalty-Card-Object.md @@ -17,7 +17,7 @@ order: 2 | campaign_id`string` |Assigned by the Voucherify API, identifies the voucher's parent campaign.
**Example:**camp_FNYR4jhqZBM9xTptxDGgeNBV
| | category`string` |Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint.
| | category_id`string` |Unique category ID assigned by Voucherify.
**Example:**cat_0bb343dee3cdb5ec0c
| -| categories`array` |Contains details about the category.
Array of [Category Object](#category-object) | +| categories`array` |Contains details about the category.
Array of [Category](#category) | | type`string` |Defines the type of the voucher.
Available values: `LOYALTY_CARD` | | discount`null` |Object representing discount parameters. Child attributes are present only if type
is DISCOUNT_VOUCHER
. Defaults to null
.
Object representing gift parameters. Child attributes are present only if type
is GIFT_VOUCHER
. Defaults to null
.
This object stores a summary of publish events: an events counter and an endpoint which can be called to return details of each event. A publication is required for loyalty cards and referral codes. This object gets updated whenever a voucher has been published. Publication means assigning a code to a particular customer. Typically, a publication is made by distributing your codes to your customers, e.g. through Export to MailChimp or publish voucher API method.
Required | Optional |
---|---|
type :LOYALTY_CARD | type :DISCOUNT_VOUCHER |
is_referral_code :true | type :GIFT_VOUCHER |
Attributes | Description |
---|---|
objectstring | The type of object represented is by default |
countinteger | Publication events counter. Example:0 |
urlstring | The endpoint where this list of publications can be accessed using a GET method. /v1/vouchers/WVPblOYX/publications?page=1&limit=10 |
The type of object represented by JSON. Default is voucher
.
Unique category ID assigned by Voucherify.
| | name`string` |Category name.
| | hierarchy`integer` |Category hierarchy.
| +| object`string` |The type of object represented by the JSON. This object stores information about the category.
Available values: `category` | | created_at`string` |Timestamp representing the date and time when the category was created in ISO 8601 format.
**Example:**2022-07-14T10:45:13.156Z
| | updated_at`string` |Timestamp representing the date and time when the category was updated in ISO 8601 format.
**Example:**2022-08-16T10:52:08.094Z
| -| object`string` |The type of object represented by the JSON. This object stores information about the category.
| +| stacking_rules_type`string` |The type of the stacking rule eligibility.
Available values: `JOINT`, `EXCLUSIVE` | [block:html] { diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 3d9daba99..be9a16adc 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -3841,7 +3841,7 @@ "type": "array", "description": "Contains details about the category.", "items": { - "$ref": "#/components/schemas/20_obj_category_object" + "$ref": "#/components/schemas/Category" } }, "type": { @@ -7368,9 +7368,9 @@ {} ] }, - "2_obj_campaign_object": { + "CampaignResponseBase": { "type": "object", - "title": "Campaign Object", + "title": "Campaign", "description": "This is an object representing a campaign.", "x-tags": [ "CAMPAIGNS API" @@ -7410,17 +7410,7 @@ ] }, "voucher": { - "anyOf": [ - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" - } - ] + "$ref": "#/components/schemas/CampaignVoucher" }, "auto_join": { "type": "boolean", @@ -7517,7 +7507,8 @@ "DONE", "IN_PROGRESS", "FAILED", - "DRAFT" + "DRAFT", + "MODIFYING" ] }, "protected": { @@ -7525,12 +7516,16 @@ "description": "Indicates whether the resource can be deleted." }, "category_id": { - "type": "string", + "type": [ "string", "null" ], "description": "Unique category ID that this campaign belongs to.", "example": "cat_0b688929a2476386a7" }, "categories": { - "$ref": "#/components/schemas/20_obj_category_object" + "type": "array", + "description": "Contains details about the category.", + "items": { + "$ref": "#/components/schemas/Category" + } }, "object": { "type": "string", @@ -7538,83 +7533,262 @@ "description": "The type of object represented by JSON. This object stores information about the campaign." }, "referral_program": { + "$ref": "#/components/schemas/ReferralProgram" + }, + "loyalty_tiers_expiration": { + "$ref": "#/components/schemas/LoyaltyTiersExpirationAll" + } + }, + "required": [ + "id", + "name", + "campaign_type", + "type", + "auto_join", + "join_once", + "use_voucher_metadata_schema", + "created_at", + "creation_status", + "vouchers_generation_status", + "protected", + "category_id", + "categories", + "object", + "metadata" + ] + }, + "CampaignResponse": { + "title": "Campaign Response", + "x-tags": [ + "CAMPAIGNS API" + ], + "allOf": [ + { + "$ref": "#/components/schemas/CampaignResponseBase" + }, + { + "title": "Campaign Additional Data", "type": "object", - "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", "properties": { - "conversion_event_type": { - "type": "string", - "enum": [ - "redemption", - "custom_event" - ], - "description": "How a referral is triggered." + "promotion": { + "$ref": "#/components/schemas/PromotionTiersList" }, - "custom_event": { - "type": "object", - "description": "Contains details about the custom event.", - "properties": { - "id": { - "type": "string", - "example": "ms_fi47Dcu5T0m3v3nT5ch3ma", - "description": "Unique custom event ID." - }, - "name": { - "type": "string", - "description": "Custom event name." - } - } + "validation_rules_assignments": { + "$ref": "#/components/schemas/ValidationRulesAssignmentsList" + } + } + } + ] + }, + "CampaignVoucher": { + "type": "object", + "description": "Schema model for a campaign voucher.", + "title": "Campaign Discount Voucher", + "properties": { + "type": { + "type": "string", + "default": "DISCOUNT_VOUCHER", + "description": "Type of voucher." + }, + "discount": { + "$ref": "#/components/schemas/Discount", + "description": "Defines the voucher discount type and details." + }, + "gift": { + "$ref": "#/components/schemas/Gift", + "description": "Defines the voucher gift details." + }, + "loyalty_card": { + "$ref": "#/components/schemas/CampaignLoyaltyCardResponse", + "description": "Defines the voucher loyalty card details." + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": [ "integer", "null" ], + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + }, + "required": [ + "quantity" + ] + }, + "code_config": { + "$ref": "#/components/schemas/CodeConfigResponse" + }, + "is_referral_code": { + "type": "boolean", + "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00: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": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." }, - "referee_reward": { - "type": "object", - "description": "Defines the referee reward.", - "properties": { - "related_object_parent": { - "type": "object", - "description": "Details of the resource from which the reward originates.", - "properties": { - "id": { - "type": "string", - "description": "Unique ID of the reward source." - }, - "name": { - "type": "string", - "description": "Name of the reward source." - }, - "object": { - "type": "string", - "description": "Type of resource represented by the source of the reward." - } - } - }, - "type": { - "type": "string", - "description": "Type of reward.", - "enum": [ - "LOYALTY_CARD", - "GIFT_VOUCHER" - ] - }, - "amount": { - "type": "string", - "description": "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." - } - } + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." } } + } + }, + "required": [ + "type", + "redemption", + "code_config", + "is_referral_code" + ] + }, + "CodeConfig": { + "title": "Code Config", + "type": "object", + "description": "Schema containing information about config used for voucher. Defines code's pattern (prefix, suffix, length, charset, etc).", + "properties": { + "length": { + "type": "string", + "description": "Number of characters in a generated code (excluding prefix and postfix)." }, - "promotion": { - "$ref": "#/components/schemas/3_res_list_promotion_tiers_from_campaign" + "charset": { + "type": "string", + "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" }, - "loyalty_tiers_expiration": { + "prefix": { + "type": "string", + "description": "A text appended before the code." + }, + "postfix": { + "type": "string", + "description": "A text appended after the code." + }, + "pattern": { + "type": "string", + "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." + }, + "initial_count": { + "type": "integer", + "description": "The initial count" + } + } + }, + "CodeConfigResponse": { + "title": "Code Config Response", + "allOf": [ + { + "$ref": "#/components/schemas/CodeConfig" + } + ], + "required": [ + "length", + "charset", + "pattern" + ] + }, + "CampaignsImportVoucherLoyaltyCard": { + "type": "object", + "description": "Schema model for a campaign loyalty card.", + "title": "Campaign Loyalty Card", + "properties": { + "points": { + "type": "integer", + "description": "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." + } + }, + "required": [ + "points" + ] + }, + "CampaignLoyaltyCardResponse": { + "type": "object", + "description": "Schema model for a campaign loyalty card.", + "title": "Campaign Loyalty Card", + "properties": { + "points": { + "type": "integer", + "description": "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." + }, + "expiration_rules": { "type": "object", - "description": "Defines the expiration mechanism for loyalty tiers.", - "anyOf": [ - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance" + "properties": { + "period_type": { + "type": "string", + "description": "Type of period" }, - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_points_in_period" + "period_value": { + "type": "integer", + "description": "Value of the period" + }, + "rounding_type": { + "type": "string", + "description": "Type of rounding" + }, + "rounding_value": { + "type": "integer", + "description": "Value of rounding" + } + }, + "required": [ + "period_type", + "period_value", + "rounding_type", + "rounding_value" + ] + } + }, + "required": [ + "points" + ] + }, + "CampaignLoyaltyCardRequestBody": { + "type": "object", + "description": "Schema representing request body model for a campaign loyalty card.", + "title": "Campaign Loyalty Card", + "properties": { + "points": { + "type": ["integer", "null" ], + "description": "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." + }, + "expiration_rules": { + "type": "object", + "properties": { + "period_type": { + "type": "string", + "description": "Type of period" + }, + "period_value": { + "type": "integer", + "description": "Value of the period" + }, + "rounding_type": { + "type": "string", + "description": "Type of rounding" + }, + "rounding_value": { + "type": "integer", + "description": "Value of rounding" } + }, + "required": [ + "period_type", + "period_value", + "rounding_type", + "rounding_value" ] } } @@ -7812,31 +7986,30 @@ } } }, - "2_req_create_campaign": { - "title": "Create Campaign Request Body", - "description": "Request body schema for **POST** `/campaigns`.", - "oneOf": [ - { - "$ref": "#/components/schemas/2_req_create_campaign_discount_voucher" - }, - { - "$ref": "#/components/schemas/2_req_create_campaign_loyalty" - }, - { - "$ref": "#/components/schemas/2_req_create_campaign_gift" + "LuckyDraw": { + "type": "object", + "title": "Lucky Draw", + "description": "Object for defining detailed information about lucky draw should be applied", + "properties": { + "winners_count": { + "description": "It represents the total number of winners in a lucky draw.", + "minimum": 1, + "type": ["string", "integer"] }, - { - "$ref": "#/components/schemas/2_req_create_campaign_promotion" + "unique_winners_per_draw" : { + "description": "It indicates whether each winner in a draw is unique or not.", + "type": ["string", "boolean"] }, - { - "$ref": "#/components/schemas/2_req_create_campaign_referral" + "unique_winners": { + "description": "Specifies whether each participant can win only once across multiple draws.", + "type": ["string", "boolean"] } - ] + } }, - "2_req_create_campaign_discount_voucher": { + "CampaignsCreateBase": { "type": "object", - "title": "Discount Campaign", - "description": "Request body schema for creating a discount voucher campaign using **POST** `/campaigns`.", + "title": "Campaign Create Schema Base", + "description": "Base body schema for creating a campaign using **POST** `/campaigns`.", "properties": { "name": { "type": "string", @@ -7863,6 +8036,10 @@ "type": "boolean", "description": "If this value is set to `true`, customers will be able to join the campaign only once." }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." + }, "use_voucher_metadata_schema": { "type": "boolean", "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." @@ -7908,6 +8085,17 @@ "type": "string", "description": "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." }, + "referral_program": { + "$ref": "#/components/schemas/ReferralProgram" + }, + "validation_rules": { + "type": "array", + "description": "Array containing the ID of the validation rule associated with the promotion tier.", + "items": { + "type": "string" + }, + "maxItems": 1 + }, "category_id": { "type": "string", "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", @@ -7920,54 +8108,14 @@ "metadata": { "type": "object", "description": "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." - }, - "voucher": { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" } } }, - "2_req_create_campaign_loyalty": { + "CampaignsUpdateBase": { "type": "object", - "title": "Loyalty Campaign", - "description": "Request body schema for creating a loyalty campaign using **POST** `/campaigns`.", + "title": "Campaign Update Schema Base", + "description": "Base body schema for creating a campaign using **PUT** `/campaigns`.", "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "default": "LOYALTY_PROGRAM", - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. CONTEXT: `LOYALTY_PROGRAM`." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, "start_date": { "type": "string", "format": "date-time", @@ -8001,14 +8149,9 @@ "type": "integer" } }, - "activity_duration_after_publishing": { - "type": "string", - "description": "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." - }, - "category_id": { + "description": { "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." }, "category": { "type": "string", @@ -8018,480 +8161,361 @@ "type": "object", "description": "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." }, - "voucher": { - "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" - } - } - }, - "2_req_create_campaign_gift": { - "type": "object", - "title": "Gift Card campaign", - "description": "Request body schema for creating a gift card campaign using **POST** `/campaigns`.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "default": "GIFT_VOUCHERS", - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00: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": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "unset_metadata_fields": { + "type": [ "array", "null" ], + "description": "Determine which metadata should be removed from campaign.", "items": { - "type": "integer" + "type": "string" } }, - "activity_duration_after_publishing": { - "type": "string", - "description": "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." - }, "category_id": { "type": "string", "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { - "type": "object", - "description": "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." - }, - "voucher": { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" } } }, - "2_req_create_campaign_referral": { + "CampaignsUpdateCouponCampaignBase": { "type": "object", - "title": "Referral Campaign", - "description": "Request body schema for creating a referral campaign using **POST** `/campaigns`.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "default": "REFERRAL_PROGRAM", - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00: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" + "title": "Update Coupon Campaign Schema Base", + "description": "Base body schema for updating a campaign which contains coupon codes using **PUT** `/campaigns`.", + "allOf": [ + { + "$ref": "#/components/schemas/CampaignsUpdateBase" }, - "validity_timeframe": { + { "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "title": "", "properties": { - "interval": { + "activity_duration_after_publishing": { "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + "description": "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." }, - "duration": { + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." + }, + "type": { "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] } } + } + ] + }, + "CampaignsUpdateDiscountCouponsCampaign": { + "type": "object", + "title": "Update Discount Coupons Campaign", + "allOf": [ + { + "$ref": "#/components/schemas/CampaignsUpdateCouponCampaignBase" }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign 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" + { + "type": "object", + "title": "Properties For Discount Coupons Campaign", + "description": "Body schema for update a campaign of discount coupons type using **PUT** `/campaigns`.", + "properties": { + "discount": { + "$ref": "#/components/schemas/Discount", + "description": "Defines the voucher discount type and details." + } } + } + ] + }, + "CampaignsUpdateGiftCampaign": { + "type": "object", + "title": "Update Gift Campaign", + "allOf": [ + { + "$ref": "#/components/schemas/CampaignsUpdateCouponCampaignBase" }, - "activity_duration_after_publishing": { - "type": "string", - "description": "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." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { + { "type": "object", - "description": "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." + "title": "Properties For Gift Campaign", + "description": "Body schema for update a campaign of give type using **PUT** `/campaigns`.", + "properties": { + "gift": { + "$ref": "#/components/schemas/Gift", + "description": "Defines the voucher gift details." + } + } + } + ] + }, + "CampaignsUpdateReferralCampaign": { + "type": "object", + "title": "Update Referral Campaign", + "allOf": [ + { + "$ref": "#/components/schemas/CampaignsUpdateCouponCampaignBase" }, - "voucher": { - "anyOf": [ - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" + { + "type": "object", + "title": "Properties For Referral Campaign", + "description": "Body schema for update a campaign of referral type using **PUT** `/campaigns`.", + "properties": { + "discount": { + "$ref": "#/components/schemas/Discount", + "description": "Defines the voucher discount type and details." }, - { - "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" + "referral_program": { + "$ref": "#/components/schemas/ReferralProgram" } - ] + } + } + ] + }, + "CampaignsUpdateLoyaltyCampaign": { + "type": "object", + "title": "Update Loyalty Campaign", + "allOf": [ + { + "$ref": "#/components/schemas/CampaignsUpdateCouponCampaignBase" }, - "referral_program": { - "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", + { "type": "object", + "title": "Properties For Loyalty Campaign", + "description": "Body schema for update a campaign of loyalty type using **PUT** `/campaigns`.", "properties": { - "conversion_event_type": { - "type": "string", - "enum": [ - "redemption", - "custom_event" - ], - "description": "Define how a referral is triggered." - }, - "custom_event": { - "type": "object", - "description": "Contains details about the custom event.", - "properties": { - "id": { - "type": "string", - "example": "ms_Ll9enAm2BCN0M1s4VxWobLFM", - "description": "Unique custom event ID." - }, - "name": { - "type": "string", - "description": "Custom event name." - } - } + "loyalty_tiers_expiration": { + "$ref": "#/components/schemas/LoyaltyTiersExpirationAll" }, - "referee_reward": { + "options": { "type": "object", - "description": "Defines the referee reward.", "properties": { - "related_object_parent": { - "type": "object", - "description": "Details of the resource from which the reward originates.", - "properties": { - "id": { - "type": "string", - "example": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "description": "Unique ID of the reward source." - }, - "name": { - "type": "string", - "description": "Name of the reward source." - }, - "object": { - "type": "string", - "enum": [ - "CAMPAIGN" - ], - "description": "Type of resource represented by the source of the reward." - } - } - }, - "type": { - "type": "string", - "enum": [ - "LOYALTY_CARD", - "GIFT_VOUCHER" - ], - "description": "Type of reward." - }, - "amount": { - "type": "string", - "description": "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." + "recalculate_tiers" : { + "type": "boolean", + "description" : "Determine if tiers should be recalculated or no." } } } } } - } + ] }, - "2_req_create_campaign_promotion": { + "CampaignsUpdateGiveawayCampaign": { "type": "object", - "title": "Promotion", - "description": "Request body schema for creating a promotions campaign using **POST** `/campaigns`.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." + "title": "Update Giveaway Campaign", + "allOf": [ + { + "$ref": "#/components/schemas/CampaignsUpdateCouponCampaignBase" }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + { + "type": "object", + "title": "Properties For Giveaway Campaign", + "description": "Body schema for update a campaign of giveaway type using **PUT** `/campaigns`.", + "$ref": "#/components/schemas/LuckyDraw" + } + ] + }, + "CampaignsUpdatePromotionCampaign": { + "type": "object", + "title": "Update Promotion Campaign", + "allOf": [ + { + "$ref": "#/components/schemas/CampaignsUpdateBase" + } + ] + }, + "CampaignsCreateRequestBody": { + "type": "object", + "title": "Create Campaign Request Body", + "description": "Request body schema for **POST** `/campaigns`.", + "oneOf": [ + { + "$ref": "#/components/schemas/CampaignsCreateDiscountCouponsCampaign" }, - "campaign_type": { - "type": "string", - "default": "PROMOTION", - "description": "Type of campaign." + { + "$ref": "#/components/schemas/CampaignsCreateReferralCampaign" }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] + { + "$ref": "#/components/schemas/CampaignsCreateGiftCampaign" }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." + { + "$ref": "#/components/schemas/CampaignsCreateLoyaltyCampaign" }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + { + "$ref": "#/components/schemas/CampaignsCreatePromotionCampaign" }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." + { + "$ref": "#/components/schemas/CampaignsCreateGiveawayCampaign" + } + ] + }, + "CampaignsUpdateRequestBody": { + "type": "object", + "title": "Update Campaign Request Body", + "description": "Request body schema for **PUT** `/campaigns/{campaignId}`.", + "oneOf": [ + { + "$ref": "#/components/schemas/CampaignsUpdateDiscountCouponsCampaign" }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" + { + "$ref": "#/components/schemas/CampaignsUpdateReferralCampaign" }, - "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" + { + "$ref": "#/components/schemas/CampaignsUpdateGiftCampaign" }, - "validity_timeframe": { + { + "$ref": "#/components/schemas/CampaignsUpdateLoyaltyCampaign" + }, + { + "$ref": "#/components/schemas/CampaignsUpdatePromotionCampaign" + }, + { + "$ref": "#/components/schemas/CampaignsUpdateGiveawayCampaign" + } + ] + }, + "CampaignsCreateDiscountCouponsCampaign": { + "title": "Create Discount Coupons Campaign", + "allOf": [ + { + "$ref": "#/components/schemas/CampaignsCreateBase" + }, + { "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "title": "Schema that contains unique properties for Discount Coupons Campaign", + "description": "Body schema for creating a campaign of discount coupons type using **POST** `/campaigns`.", "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + "voucher": { + "$ref": "#/components/schemas/DiscountCouponsCampaignVoucher" } } + } + ] + }, + "CampaignsCreateReferralCampaign": { + "title": "Create Referral Program", + "allOf": [ + { + "$ref": "#/components/schemas/CampaignsCreateBase" }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign 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" + { + "type": "object", + "title": "Schema that contains unique properties for Referral Program", + "description": "Body schema for creating a campaign of referral type using **POST** `/campaigns`.", + "properties": { + "voucher": { + "$ref": "#/components/schemas/ReferralCampaignVoucher" + } } + } + ] + }, + "CampaignsCreateGiftCampaign": { + "title": "Create Gift Campaign", + "allOf": [ + { + "$ref": "#/components/schemas/CampaignsCreateBase" }, - "activity_duration_after_publishing": { - "type": "string", - "description": "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." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + { + "type": "object", + "title": "Schema that contains unique properties for Gift Campaign", + "description": "Body schema for creating a campaign of gift type using **POST** `/campaigns`.", + "properties": { + "voucher": { + "$ref": "#/components/schemas/GiftCampaignVoucher" + } + } + } + ] + }, + "CampaignsCreateLoyaltyCampaign": { + "title": "Create Loyalty Campaign", + "allOf": [ + { + "$ref": "#/components/schemas/CampaignsCreateBase" }, - "metadata": { + { "type": "object", - "description": "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." + "title": "Schema that contains unique properties for Loyalty Campaign", + "description": "Body schema for creating a campaign of loyalty type using **POST** `/campaigns`.", + "properties": { + "voucher": { + "$ref": "#/components/schemas/LoyaltyCampaignVoucher" + } + } + } + ] + }, + "CampaignsCreatePromotionCampaign": { + "title": "Create Promotion Campaign", + "allOf": [ + { + "$ref": "#/components/schemas/CampaignsCreateBase" }, - "promotion": { + { "type": "object", - "description": "Define the promotion tiers within the campaign.", + "title": "Schema that contains unique properties for Promotion Campaign", + "description": "Body schema for creating a campaign of promotion type using **POST** `/campaigns`.", "properties": { - "tiers": { - "type": "array", + "promotion": { + "type": [ "array", "null" ], "items": { - "$ref": "#/components/schemas/3_req_add_promotion_tier_to_campaign" + "$ref": "#/components/schemas/PromotionTierCreateParams" } } } } - } + ] }, - "2_req_update_campaign": { - "type": "object", - "title": "Update Campaign Request Body", - "description": "Request body schema for **PUT** `/campaigns/{campaignId}`.", - "properties": { - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." + "CampaignsCreateGiveawayCampaign": { + "title": "Create Giveaway Campaign", + "allOf": [ + { + "$ref": "#/components/schemas/CampaignsCreateBase" }, - "validity_timeframe": { + { "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "title": "Schema that contains unique properties for Giveaway Campaign", + "description": "Body schema for creating a campaign of giveaway type using **POST** `/campaigns`.", "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + "voucher": { + "$ref": "#/components/schemas/GiveawayCampaignVoucher" }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + "lucky_draw": { + "$ref": "#/components/schemas/LuckyDraw" } } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign 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" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "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." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00: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" - }, - "metadata": { + } + ] + }, + "CampaignsCreateCampaignVoucherWithCodeRequestBody": { + "type": "object", + "title": "Add Voucher With Code To Campaign Request Body", + "allOf": [ + { "type": "object", - "description": "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." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter or the `category` parameter.", - "example": "cat_0b688929a2476386a7" + "properties": { + "code": { + "type": "string", + "description": "Unique custom voucher code." + } + } }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id` parameter." + { + "$ref": "#/components/schemas/CampaignsCreateCampaignVoucherRequestBody" } - } + ] }, - "2_req_add_vouchers_to_campaign": { + "CampaignsCreateCampaignVoucherRequestBody": { "type": "object", - "title": "Add Vouchers to Campaign Request Body", + "title": "Add Voucher To Campaign Request Body", "description": "Request body schema for **POST** `/campaigns/{campaignId}/vouchers`.", "properties": { - "category_id": { - "type": "string", - "description": "Unique category ID that you would like to assign to the voucher.", - "example": "cat_0b688929a2476386a7" - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { + "category": { "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." }, "metadata": { "type": "object", @@ -8507,35 +8531,24 @@ } } }, + "code_config": { + "$ref": "#/components/schemas/CodeConfig" + }, "additional_info": { "type": "string", "description": "An optional field to keep any extra textual information about the code such as a code description and details." }, - "code_config": { - "type": "object", - "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", - "properties": { - "length": { - "type": "string", - "description": "Number of characters in a generated code (excluding prefix and postfix)." - }, - "charset": { - "type": "string", - "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" - }, - "prefix": { - "type": "string", - "description": "A text appended before the code." - }, - "postfix": { - "type": "string", - "description": "A text appended after the code." - }, - "pattern": { - "type": "string", - "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." - } - } + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" } } }, @@ -8585,15 +8598,15 @@ } } }, - "2_req_import_vouchers_to_campaign": { + "CampaignsImportVoucherRequestBody": { "type": "array", "title": "Import Vouchers to Campaign Request Body", "description": "Request body schema for **POST** `/campaigns/{campaignId}/import`.", "items": { - "$ref": "#/components/schemas/2_obj_import_vouchers_to_campaign_object" + "$ref": "#/components/schemas/CampaignsImportVoucherItem" } }, - "2_obj_import_vouchers_to_campaign_object": { + "CampaignsImportVoucherItem": { "type": "object", "title": "Import Vouchers to Campaign", "description": "Import Vouchers to Campaign", @@ -8602,14 +8615,25 @@ "type": "string", "description": "Unique custom voucher code." }, - "category_id": { + "type": { "type": "string", - "description": "Unique category ID that you would like to assign to the voucher. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" + "description": "Type of voucher.", + "enum": [ + "DISCOUNT_VOUCHER", + "GIFT_VOUCHER", + "LOYALTY_CARD", + "LUCKY_DRAW_CODE" + ] }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + "redemption": { + "type": "object", + "description": "Stores the quantity of redemptions that can be applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } }, "active": { "type": "boolean", @@ -8619,39 +8643,52 @@ "type": "object", "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." }, - "redemption": { + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "validity_timeframe": { "type": "object", - "description": "Stores the quantity of redemptions that can be applied to the voucher.", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." } } }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign 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" + } + }, "additional_info": { "type": "string", "description": "An optional field to keep any extra textual information about the code such as a code description and details." }, - "loyalty_card": { - "type": "object", - "description": " Assign an initial points balance for a loyalty card. Context: `LOYALTY_PROGRAM`.", - "properties": { - "points": { - "type": "integer", - "description": "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." - } - } + "discount": { + "$ref": "#/components/schemas/Discount", + "description": "Defines the voucher discount type and details." }, "gift": { - "type": "object", - "description": "Assign an initial cash balance for a gift card. Context: `GIFT_VOUCHERS`.", - "properties": { - "amount": { - "type": "integer", - "description": "The cash balance to assign to the gift card. This is the current gift card balance." - } - } + "$ref": "#/components/schemas/Gift", + "description": "Defines the voucher gift details." + }, + "loyalty_card": { + "$ref": "#/components/schemas/CampaignsImportVoucherLoyaltyCard", + "description": "Defines the voucher loyalty card details." } }, "required": [ @@ -8957,7 +8994,7 @@ "example": "cat_0b688929a2476386a7" }, "categories": { - "$ref": "#/components/schemas/20_obj_category_object" + "$ref": "#/components/schemas/Category" }, "object": { "type": "string", @@ -9031,7 +9068,7 @@ } } }, - "2_res_list_campaigns": { + "CampaignsListResponseBody": { "type": "object", "description": "Schema model for **GET** `/campaigns`.", "title": "List Campaigns Response Body", @@ -9050,7 +9087,7 @@ "type": "array", "description": "Contains array of campaign objects.", "items": { - "$ref": "#/components/schemas/2_obj_campaign_object" + "$ref": "#/components/schemas/CampaignResponseBase" } }, "total": { @@ -9059,6 +9096,184 @@ } } }, + "DiscountCouponsCampaignVoucher": { + "title": "Object representing voucher property for Discount Coupons Campaign", + "properties": { + "type": { + "type": "string", + "default": "DISCOUNT_VOUCHER", + "description": "Type of voucher.", + "enum": [ + "DISCOUNT_VOUCHER" + ] + }, + "discount": { + "$ref": "#/components/schemas/Discount" + }, + "code_config": { + "$ref": "#/components/schemas/CodeConfig" + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": [ "integer", "null" ], + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + } + }, + "required": [ + "type", + "discount" + ] + }, + "ReferralCampaignVoucher": { + "title": "Object representing voucher property for Referal Program", + "properties": { + "type": { + "type": "string", + "default": "DISCOUNT_VOUCHER", + "description": "Type of voucher.", + "enum": [ + "DISCOUNT_VOUCHER" + ] + }, + "discount": { + "$ref": "#/components/schemas/Discount" + }, + "code_config": { + "$ref": "#/components/schemas/CodeConfig" + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": [ "integer", "null" ], + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "is_referral_code": { + "type": "boolean", + "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." + } + }, + "required": [ + "type", + "discount", + "is_referral_code" + ] + }, + "GiveawayCampaignVoucher": { + "title": "Object representing voucher property for Giveaway Campaign", + "properties": { + "type": { + "type": "string", + "default": "DISCOUNT_VOUCHER", + "description": "Type of voucher.", + "enum": [ + "DISCOUNT_VOUCHER" + ] + }, + "discount": { + "$ref": "#/components/schemas/Discount" + }, + "code_config": { + "$ref": "#/components/schemas/CodeConfig" + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": [ "integer", "null" ], + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "is_referral_code": { + "type": "boolean", + "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." + } + }, + "required": [ + "type", + "discount" + ] + }, + "GiftCampaignVoucher": { + "type": "object", + "description": "Schema model for a discount voucher.", + "title": "Discount Voucher", + "properties": { + "type": { + "type": "string", + "default": "GIFT_VOUCHER", + "description": "Type of voucher.", + "enum": [ + "GIFT_VOUCHER" + ] + }, + "gift": { + "$ref": "#/components/schemas/Gift" + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": [ "integer", "null" ], + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "code_config": { + "$ref": "#/components/schemas/CodeConfig" + } + }, + "required": [ + "type", + "gift" + ] + }, + "LoyaltyCampaignVoucher": { + "type": "object", + "description": "Schema model for a discount voucher.", + "title": "Discount Voucher", + "properties": { + "type": { + "type": "string", + "default": "LOYALTY_CARD", + "description": "Type of voucher.", + "enum": [ + "LOYALTY_CARD" + ] + }, + "loyalty_card": { + "$ref": "#/components/schemas/CampaignLoyaltyCardRequestBody" + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": [ "integer", "null" ], + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "code_config": { + "$ref": "#/components/schemas/CodeConfig" + } + }, + "required": [ + "type", + "loyalty_card" + ] + }, "2_obj_campaign_object_voucher_object_DISCOUNT": { "type": "object", "description": "Schema model for a discount voucher.", @@ -9418,7 +9633,8 @@ "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", "x-tags": [ - "PROMOTIONS API" + "PROMOTIONS API", + "CAMPAIGNS API" ], "properties": { "id": { @@ -9616,6 +9832,98 @@ } } }, + "PromotionTierCreateParams": { + "type": "object", + "description": "This is an object representing a promotion tier create params. Promotion tiers are always assigned to a campaign and cannot be used standalone.", + "title": "Promotion Tier", + "x-tags": [ + "PROMOTIONS API", + "CAMPAIGNS API" + ], + "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." + }, + "validation_rules": { + "type": "array", + "description": "Array containing the ID of the validation rule associated with the promotion tier.", + "items": { + "type": "string" + } + }, + "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" + }, + "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": { + "type": "object", + "description": "Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the promotion tier 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" + } + }, + "category": { + "type": "string", + "description": "Assign category to the promotion tier." + }, + "category_id": { + "type": "string", + "description": "Instead of using the category name, you can alternatively assign a new category to a promotion tier using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.", + "example": "cat_0c9da30e7116ba6bba" + } + }, + "required": [ + "name" + ] + }, "3_req_add_promotion_tier_to_campaign": { "type": "object", "description": "Request body schema for creating a promotion tier within a campaign in **POST** `/promotions/{campaignId}/tiers`.", @@ -9839,7 +10147,7 @@ } } }, - "3_res_list_promotion_tiers_from_campaign": { + "PromotionTiersList": { "type": "object", "description": "Promotion Tiers", "title": "Promotion Tiers", @@ -13389,7 +13697,7 @@ "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`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" }, "categories": { - "$ref": "#/components/schemas/20_obj_category_object" + "$ref": "#/components/schemas/Category" }, "object": { "type": "string", @@ -13425,7 +13733,7 @@ "example": "cat_0c9da30e7116ba6bba" }, "categories": { - "$ref": "#/components/schemas/20_obj_category_object", + "$ref": "#/components/schemas/Category", "description": "Details about the category assigned to the promotion tier." } } @@ -13577,7 +13885,7 @@ "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`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" }, "categories": { - "$ref": "#/components/schemas/20_obj_category_object" + "$ref": "#/components/schemas/Category" }, "object": { "type": "string", @@ -21029,7 +21337,7 @@ "example": "cat_0b688929a2476386a7" }, "categories": { - "$ref": "#/components/schemas/20_obj_category_object" + "$ref": "#/components/schemas/Category" }, "loyalty_tiers_expiration": { "type": "object", @@ -21193,7 +21501,7 @@ "type": "array", "description": "Contains details about the category.", "items": { - "$ref": "#/components/schemas/20_obj_category_object" + "$ref": "#/components/schemas/Category" } }, "loyalty_tiers_expiration": { @@ -21321,7 +21629,7 @@ "type": "array", "description": "Contains details about the category.", "items": { - "$ref": "#/components/schemas/20_obj_category_object" + "$ref": "#/components/schemas/Category" } }, "type": { @@ -21686,7 +21994,7 @@ "type": "array", "description": "Contains details about the category.", "items": { - "$ref": "#/components/schemas/20_obj_category_object" + "$ref": "#/components/schemas/Category" } }, "type": { @@ -24111,6 +24419,112 @@ } } }, + "LoyaltyTiersExpirationAll": { + "title": "Loyalty Tiers Expiration", + "type": "object", + "description": "Defines the Loyalty Tiers Expiration.", + "properties": { + "qualification_type": { + "type": "string", + "enum": [ + "BALANCE", + "POINTS_IN_PERIOD" + ], + "description": "Tier qualification. \n\n`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. \n `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." + }, + "qualification_period": { + "type": "string", + "description": "Customers 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. \n\n| **Period** | **Definition** |\n|:---|:---|\n| **Calendar Month** | Points collected in one calendar month