diff --git a/Changelog.md b/Changelog.md index 457b13528..110835c39 100644 --- a/Changelog.md +++ b/Changelog.md @@ -22,14 +22,14 @@ #### Schemas changes - GET /v1/loyalties/{campaignId}/tiers - new response schema `LoyaltiesListTiersResponseBody` (old `8_res_list_loyalty_tiers`) -- GET /v1/loyalties/members/{memberId}/balance +- GET /v1/loyalties/{campaignId}/reward-assignments/{assignmentId} - new response schema `LoyaltiesGetRewardAssignmentResponseBody` (old `4_obj_reward_assignment_object`) - GET /v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward - new response schema `LoyaltiesGetRewardDetailsResponseBody` (old `4_obj_reward_object`) - GET /v1/loyalties/{campaignId}/tiers/{tierId} - new response schema `LoyaltiesGetTierResponseBody` (old `8_obj_loyalty_tier_object`) - GET /v1/loyalties/{campaignId}/tiers/{tierId}/earning-rules - - new response schema `LoyaltiesListLoyaltyTierEarningRulesRequestQuery` (old `8_res_list_loyalty_tier_earning_rules`) + - new response schema `LoyaltiesListLoyaltyTierEarningRulesResponseBody` (old `8_res_list_loyalty_tier_earning_rules`) - GET /v1/loyalties/members/{memberId}/tiers - new response schema `LoyaltiesListMemberLoyaltyTiersResponseBody` (old `8_res_get_member_loyalty_tier`) - GET /v1/loyalties/{campaignId}/members/{memberId}/points-expiration diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index bf909316f..ebae0b544 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39344,40 +39344,7 @@ ] }, "LoyaltiesGetEarningRuleResponseBody": { - "allOf": [ - { - "$ref": "#/components/schemas/EarningRuleBase" - }, - { - "type": "object", - "properties": { - "validation_rule_id": { - "type": [ - "string", - "null" - ], - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "updated_at": { - "type": [ - "string", - "null" - ], - "format": "date-time", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the start_date and expiration_date of the campaign or the earning rule's own start_date and expiration_date.\n\n- `true` indicates an active earning rule\n- `false` indicates an inactive earning rule" - } - }, - "required": [ - "validation_rule_id", - "updated_at", - "active" - ] - } - ] + "$ref": "#/components/schemas/EarningRule" }, "LoyaltiesEnableEarningRulesResponseBody": { "allOf": [ @@ -40801,25 +40768,32 @@ "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique reward assignment ID, assigned by Voucherify." }, "reward_id": { - "type": "string" + "type": "string", + "description": "Associated reward ID." }, "related_object_id": { - "type": "string" + "type": "string", + "description": "Related object ID to which the reward was assigned." }, "related_object_type": { - "type": "string" + "type": "string", + "description": "Related object type to which the reward was assigned." }, "parameters": { "type": "object", + "description": "Defines the cost of the reward.", "properties": { "loyalty": { "type": "object", + "description": "Defines the equivalent points value of the reward.", "properties": { "points": { - "type": "integer" + "type": "integer", + "description": "The number of points required to redeem the reward." } }, "required": [ @@ -40829,13 +40803,18 @@ } }, "created_at": { - "type": "string" + "type": "string", + "description": "Timestamp representing the date and time when the reward assignment was created in ISO 8601 format.", + "format": "date-time" }, "updated_at": { - "type": "string" + "type": "string", + "description": "Timestamp representing the date and time when the reward assignment was updated in ISO 8601 format.", + "format": "date-time" }, "object": { - "type": "string" + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the reward assignment." } }, "required": [ @@ -40846,44 +40825,55 @@ ] }, "Reward": { - "title": "Reward", "allOf": [ { "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique reward ID, assigned by Voucherify." }, "name": { - "type": "string" + "type": "string", + "description": "Reward name." }, "stock": { - "type": "integer" + "type": "integer", + "description": "Configurable for material rewards. The number of units of the product that you want to share as reward." }, "redeemed": { - "type": "integer" + "type": "integer", + "description": "Defines the number of already invoked (successful) reward redemptions." }, "attributes": { "type": "object", + "description": "These properties are configurable for material rewards.", "properties": { "image_url": { - "type": "string" + "type": "string", + "description": "The HTTPS URL pointing to the .png or .jpg file." }, "description": { - "type": "string" + "type": "string", + "description": "An arbitrary string that you can attach to a material reward." } } }, "created_at": { - "type": "string" + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the reward was created in ISO 8601 format." }, "updated_at": { - "type": "string" + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the reward was updated in ISO 8601 format." }, "object": { "type": "string", "default": "reward", - "pattern": "reward" + "pattern": "reward", + "description": "The type of object represented by the JSON. This object stores information about the reward." } }, "required": [ @@ -40897,6 +40887,20 @@ } ] }, + "RewardType": { + "title": "Reward Type", + "anyOf": [ + { + "$ref": "#/components/schemas/RewardTypeCampaign" + }, + { + "$ref": "#/components/schemas/RewardTypeCoin" + }, + { + "$ref": "#/components/schemas/RewardTypeCoin" + } + ] + }, "RewardTypeCoin": { "title": "Reward Type Coin", "type": "object", @@ -40905,25 +40909,30 @@ "type": "string", "enum": [ "COIN" - ] + ], + "description": "Reward type." }, "parameters": { "type": "object", "required": [ "coin" ], + "description": "Defines how the reward is generated.", "properties": { "coin": { "type": "object", "required": [ "exchange_ratio" ], + "description": "Defines the ratio by mapping the number of loyalty points in points_ratio to a predefined cash amount in exchange_ratio.", "properties": { "exchange_ratio": { - "type": "number" + "type": "number", + "description": "The cash equivalent of the points defined in the points_ratio property." }, "points_ratio": { - "type": "integer" + "type": "integer", + "description": "The number of loyalty points that will map to the predefined cash amount defined by the exchange_ratio property." } } } @@ -40943,13 +40952,15 @@ "type": "string", "enum": [ "MATERIAL" - ] + ], + "description": "Reward type." }, "parameters": { "type": "object", "required": [ "product" ], + "description": "Defines how the reward is generated.", "properties": { "product": { "type": "object", @@ -40957,15 +40968,18 @@ "id", "sku" ], + "description": "Contains information about the product given as a reward.", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique product ID, assigned by Voucherify." }, "sku": { "type": [ "string", "null" - ] + ], + "description": "Unique SKU ID, assigned by Voucherify, of the SKU given as a reward." } } } @@ -40985,13 +40999,15 @@ "type": "string", "enum": [ "CAMPAIGN" - ] + ], + "description": "Reward type." }, "parameters": { "type": "object", "required": [ "campaign" ], + "description": "Defines how the reward is generated.", "properties": { "campaign": { "type": "object", @@ -40999,12 +41015,15 @@ "id", "type" ], + "description": "Objects stores information about the campaign related to the reward.", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify." }, "balance": { - "type": "integer" + "type": "integer", + "description": "The incremental amout to be added to the current balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." }, "type": { "type": "string", @@ -41013,7 +41032,8 @@ "PROMOTION", "GIFT_VOUCHERS", "REFERRAL_PROGRAM" - ] + ], + "description": "Campaign type." } } } @@ -41025,20 +41045,6 @@ "parameters" ] }, - "RewardType": { - "title": "Reward Type", - "anyOf": [ - { - "$ref": "#/components/schemas/RewardTypeCampaign" - }, - { - "$ref": "#/components/schemas/RewardTypeCoin" - }, - { - "$ref": "#/components/schemas/RewardTypeCoin" - } - ] - }, "LoyaltiesAddOrRemoveCardBalanceResponseBody": { "title": "Loyalties Add Or Remove Card Balance Response Body", "type": "object", @@ -43234,6 +43240,470 @@ ], "title": "Any" }, + "LoyaltiesCreateTiersRequestBody": { + "title": "Loyalties Create Tiers Request Body", + "x-stoplight": { + "id": "i1emmwlaqp7lt" + }, + "type": "array", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/LoyaltyTierBase" + }, + { + "type": "object", + "properties": { + "metadata": { + "description": "The metadata object stores all custom attributes assigned to the loyalty tier. A set of key/value pairs that you can attach to a loyalty tier object. It can be useful for storing additional information about the loyalty tier in a structured format.", + "type": "object" + } + } + } + ] + } + }, + "LoyaltiesCreateTiersResponseBody": { + "title": "Loyalties Create Tiers Response Body", + "x-stoplight": { + "id": "ix7g5mnuwqsp6" + }, + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyTier" + } + }, + "LoyaltiesGetRewardAssignmentResponseBody": { + "$ref": "#/components/schemas/RewardAssignment", + "x-stoplight": { + "id": "fnbbaq9l1l9it" + } + }, + "LoyaltiesGetRewardDetailsResponseBody": { + "$ref": "#/components/schemas/Reward", + "x-stoplight": { + "id": "44hds9u0hhukf" + } + }, + "LoyaltiesListTiersRequestQuery": { + "title": "Loyalties List Tiers Request Query", + "x-stoplight": { + "id": "d5sluzqkxu8km" + }, + "type": "object", + "properties": { + "limit": { + "type": "integer", + "minimum": 1, + "multipleOf": 100, + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." + }, + "page": { + "type": "integer", + "description": "Which page of results to return." + }, + "order": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ], + "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + } + } + }, + "LoyaltiesListLoyaltyTierEarningRulesRequestQuery": { + "title": "LoyaltiesListLoyaltyTierEarningRulesRequestQuery", + "x-stoplight": { + "id": "zs0z1cyyzac9u" + }, + "type": "object", + "properties": { + "limit": { + "type": "integer", + "minimum": 1, + "multipleOf": 100, + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." + }, + "page": { + "type": "integer", + "description": "Which page of results to return." + } + } + }, + "LoyaltiesGetTierResponseBody": { + "$ref": "#/components/schemas/LoyaltyTier", + "x-stoplight": { + "id": "hzcsijl2b4d5o" + } + }, + "LoyaltiesListTiersResponseBody": { + "title": "Loyalties List Tiers Response Body", + "x-stoplight": { + "id": "kw06g2szvv479" + }, + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." + }, + "data_ref": { + "type": "string", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." + }, + "data": { + "type": "array", + "description": "This is an object representing a loyalty tier. Loyalty tiers are used to create a loyalty program with different levels of membership and varied earning rules and rewards based on customer’s tiers.", + "items": { + "$ref": "#/components/schemas/LoyaltyTier" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty tier objects." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "LoyaltiesListMemberLoyaltyTiersResponseBody": { + "title": "Loyalties List Member Loyalty Tiers Response Body", + "x-stoplight": { + "id": "s3zpgud510xl6" + }, + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." + }, + "data_ref": { + "type": "string", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyTier" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty tier objects." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "EarningRule": { + "allOf": [ + { + "$ref": "#/components/schemas/EarningRuleBase" + }, + { + "type": "object", + "properties": { + "validation_rule_id": { + "type": [ + "string", + "null" + ], + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the start_date and expiration_date of the campaign or the earning rule's own start_date and expiration_date.\n\n- `true` indicates an active earning rule\n- `false` indicates an inactive earning rule" + } + }, + "required": [ + "validation_rule_id", + "updated_at", + "active" + ] + } + ] + }, + "LoyaltiesListLoyaltyTierEarningRulesResponseBody": { + "title": "Loyalties List Loyalty Tier Earning Rules ResponseBody", + "x-stoplight": { + "id": "i180zbh3ffwaa" + }, + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about earning rules in a dictionary." + }, + "data_ref": { + "type": "string", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of earning rule objects." + }, + "data": { + "type": "array", + "description": "Contains array of earning rule objects.", + "items": { + "$ref": "#/components/schemas/EarningRule" + } + }, + "total": { + "type": "integer", + "description": "Total number of earning rule objects." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "LoyaltyTierBase": { + "title": "Loyalty Tier Base", + "x-stoplight": { + "id": "3af9422223696" + }, + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Loyalty Tier name." + }, + "earning_rules": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/MappingPoints" + }, + "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule." + }, + "rewards": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/MappingPoints" + }, + "description": "Contains a list of reward IDs and their points mapping for the given reward." + }, + "points": { + "type": "object", + "description": "Defines range of loyalty tier in points.", + "properties": { + "from": { + "type": "integer", + "description": "Bottom points threshold value." + }, + "to": { + "type": "integer", + "description": "Top points threshold value." + } + } + } + }, + "required": [ + "name", + "points" + ] + }, + "LoyaltyTier": { + "allOf": [ + { + "$ref": "#/components/schemas/LoyaltyTierBase" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique loyalty tier ID." + }, + "campaign_id": { + "type": "string", + "description": "Unique parent campaign ID." + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "The metadata object stores all custom attributes assigned to the loyalty tier. A set of key/value pairs that you can attach to a loyalty tier object. It can be useful for storing additional information about the loyalty tier in a structured format." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." + }, + "config": { + "type": "object", + "description": "Defines loyalty tier range in points.", + "required": [ + "points" + ], + "properties": { + "points": { + "type": "object", + "description": "Defines range of loyalty tier in points.", + "properties": { + "from": { + "type": "integer", + "description": "Bottom points threshold value." + }, + "to": { + "type": "integer", + "description": "Top points threshold value." + } + } + } + } + }, + "expiration": { + "type": "object", + "description": "Defines loyalty tier expiration date.", + "properties": { + "customer_id": { + "type": "string" + }, + "campaign_id": { + "type": "string" + }, + "tier_id": { + "type": "string" + }, + "start_date": { + "type": "string", + "format": "date-time" + }, + "expiration_date": { + "type": "string", + "format": "date-time" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "customer_id", + "campaign_id", + "tier_id", + "created_at" + ] + }, + "object": { + "type": "string", + "enum": [ + "loyalty_tier" + ], + "description": "The type of object represented by JSON. This object stores information about the loyalty." + } + }, + "required": [ + "id", + "campaign_id", + "metadata", + "created_at", + "config", + "object" + ] + } + ] + }, + "MappingMultiply": { + "title": "MappingMultiply", + "x-stoplight": { + "id": "7zrwgr2oqh4tj" + }, + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "MULTIPLY" + ], + "description": "Type of calculation." + }, + "multiplier": { + "type": "number", + "description": "Multiplication factor used to multiply the points to obtain the mapped points." + } + } + }, + "MappingFixed": { + "title": "MappingFixed", + "x-stoplight": { + "id": "86eksegayxcxa" + }, + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "CUSTOM" + ], + "description": "Type of calculation.\n\n" + }, + "points": { + "type": "integer", + "description": "Fixed number of points to be applied." + } + } + }, + "MappingPoints": { + "anyOf": [ + { + "$ref": "#/components/schemas/MappingMultiply" + }, + { + "$ref": "#/components/schemas/MappingFixed" + } + ] + }, "a_req_importCSV": { "type": "object", "title": "Import CSV file", @@ -71336,7 +71806,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/4_obj_reward_object" + "$ref": "#/components/schemas/LoyaltiesGetRewardDetailsResponseBody" }, "examples": { "Material": { @@ -71869,7 +72339,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + "$ref": "#/components/schemas/LoyaltiesGetRewardAssignmentResponseBody" }, "examples": { "Example": { @@ -73953,7 +74423,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_list_loyalty_tiers" + "$ref": "#/components/schemas/LoyaltiesListTiersResponseBody" }, "examples": { "Example": { @@ -74121,7 +74591,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_object" + "$ref": "#/components/schemas/LoyaltiesGetTierResponseBody" }, "examples": { "Example": { @@ -74211,7 +74681,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_get_member_loyalty_tier" + "$ref": "#/components/schemas/LoyaltiesListMemberLoyaltyTiersResponseBody" }, "examples": { "Example": { @@ -74334,7 +74804,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_list_loyalty_tier_earning_rules" + "$ref": "#/components/schemas/LoyaltiesListLoyaltyTierEarningRulesResponseBody" }, "examples": { "example-1": {