diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 88e5ec1d3..73fa0fd31 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -9560,38 +9560,6 @@ "object" ] }, - "reward_parameters": { - "title": "Reward Object Parameters", - "type": "object", - "properties": { - "parameters": { - "oneOf": [ - { - "$ref": "#/components/schemas/reward_parameters_CAMPAIGN" - }, - { - "$ref": "#/components/schemas/reward_parameters_COIN" - }, - { - "$ref": "#/components/schemas/reward_parameters_MATERIAL" - } - ], - "description": "Defines how the reward is generated." - }, - "type": { - "description": "Reward type.", - "enum": [ - "CAMPAIGN", - "COIN", - "MATERIAL" - ] - } - }, - "required": [ - "parameters", - "type" - ] - }, "reward": { "title": "Reward", "description": "This is an object representing a reward.", @@ -9606,7 +9574,7 @@ "$ref": "#/components/schemas/reward_base" }, { - "$ref": "#/components/schemas/reward_parameters" + "$ref": "#/components/schemas/reward_type" }, { "$ref": "#/components/schemas/reward_response_data" @@ -9723,30 +9691,6 @@ } } }, - "reward_parameters_CAMPAIGN": { - "title": "Digital", - "type": "object", - "description": "These are parameters representing a digital (CAMPAIGN) reward. These can be in the form of discount coupons, gift card credits, or loyalty point credits.", - "properties": { - "campaign": { - "description": "Objects stores information about the campaign related to the reward.", - "anyOf": [ - { - "$ref": "#/components/schemas/4_obj_reward_object_parameters_CAMPAIGN_DISCOUNT_COUPONS" - }, - { - "$ref": "#/components/schemas/4_obj_reward_object_parameters_CAMPAIGN_GIFT_VOUCHERS" - }, - { - "$ref": "#/components/schemas/4_obj_reward_object_parameters_CAMPAIGN_LOYALTY_PROGRAM" - } - ] - } - }, - "required": [ - "campaign" - ] - }, "4_obj_reward_object_parameters_CAMPAIGN_DISCOUNT_COUPONS": { "title": "Discount Coupons", "type": "object", @@ -9841,34 +9785,6 @@ } } }, - "reward_parameters_COIN": { - "title": "Pay with Points", - "type": "object", - "description": "These are parameters representing a Pay with Points (COIN) reward. ", - "properties": { - "coin": { - "type": "object", - "description": "Defines the ratio by mapping the number of loyalty points in `points_ratio` to a predefined cash amount in `exchange_ratio`.", - "required": [ - "exchange_ratio", - "points_ratio" - ], - "properties": { - "exchange_ratio": { - "type": "integer", - "description": "The cash equivalent of the points defined in the `points_ratio` property." - }, - "points_ratio": { - "type": "integer", - "description": "The number of loyalty points that will map to the predefined cash amount defined by the `exchange_ratio` property." - } - } - } - }, - "required": [ - "coin" - ] - }, "4_obj_reward_object_parameters_MATERIAL": { "title": "Material", "type": "object", @@ -9895,39 +9811,6 @@ } } }, - "reward_parameters_MATERIAL": { - "title": "Material", - "type": "object", - "description": "These are parameters representing products as a (MATERIAL) reward.", - "properties": { - "product": { - "type": "object", - "description": "Contains information about the product given as a reward.", - "required": [ - "id", - "sku_id" - ], - "properties": { - "id": { - "type": "string", - "example": "prod_0b7d7dfb05cbe5c616", - "description": "Unique product ID, assigned by Voucherify. " - }, - "sku_id": { - "type": [ - "string", - "null" - ], - "description": "Unique SKU ID, assigned by Voucherify, of the SKU given as a reward.", - "example": "sku_0b7d7dfb090be5c619" - } - } - } - }, - "required": [ - "product" - ] - }, "4_req_create_reward": { "title": "Create Reward Request Body", "description": "Request body schema for **POST** `/rewards`.", @@ -41368,84 +41251,21 @@ "object" ] }, - "Reward": { - "allOf": [ - { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID, assigned by Voucherify." - }, - "name": { - "type": "string", - "description": "Reward name." - }, - "stock": { - "type": "integer", - "description": "Configurable for material rewards. The number of units of the product that you want to share as reward." - }, - "redeemed": { - "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", - "description": "The HTTPS URL pointing to the .png or .jpg file." - }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a material reward." - } - } - }, - "created_at": { - "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", - "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", - "description": "The type of object represented by the JSON. This object stores information about the reward." - } - }, - "required": [ - "id", - "created_at", - "object" - ] - }, - { - "$ref": "#/components/schemas/RewardType" - } - ] - }, - "RewardType": { + "reward_type": { "title": "Reward Type", "anyOf": [ { - "$ref": "#/components/schemas/RewardTypeCampaign" + "$ref": "#/components/schemas/reward_type_campaign" }, { - "$ref": "#/components/schemas/RewardTypeCoin" + "$ref": "#/components/schemas/reward_type_coin" }, { - "$ref": "#/components/schemas/RewardTypeMaterial" + "$ref": "#/components/schemas/reward_type_material" } ] }, - "RewardTypeCoin": { + "reward_type_coin": { "title": "Reward Type Coin", "type": "object", "properties": { @@ -41488,7 +41308,7 @@ "parameters" ] }, - "RewardTypeMaterial": { + "reward_type_material": { "title": "Reward Type Material", "type": "object", "properties": { @@ -41535,7 +41355,7 @@ "parameters" ] }, - "RewardTypeCampaign": { + "reward_type_campaign": { "title": "Reward Type Campaign", "type": "object", "properties": {