From 3142385dc66bd59e71405ba5ab6d86045aff781f Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 12 Oct 2023 11:07:23 +0200 Subject: [PATCH 01/20] Update OpenAPI.json --- reference/OpenAPI.json | 104 +++++++++++++++++++++++++---------------- 1 file changed, 65 insertions(+), 39 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 907e4524b..12499613c 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -9506,11 +9506,17 @@ "description": "Defines how the reward is generated." }, "stock": { - "type": "integer", + "type": [ + "integer", + "null" + ], "description": "Configurable for **material rewards**. The number of units of the product that you want to share as reward." }, "redeemed": { - "type": "integer", + "type": [ + "integer", + "null" + ], "description": "Defines the number of already invoked (successful) reward redemptions.\t" }, "attributes": { @@ -9551,7 +9557,20 @@ "default": "reward", "description": "The type of object represented by the JSON. This object stores information about the reward." } - } + }, + "required": [ + "id", + "name", + "type", + "parameters", + "stock", + "redeemed", + "attributes", + "created_at", + "updated_at", + "metadata", + "object" + ] }, "4_obj_reward_object_parameters_CAMPAIGN": { "title": "Digital", @@ -9641,6 +9660,10 @@ "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", @@ -9652,7 +9675,10 @@ } } } - } + }, + "required": [ + "coin" + ] }, "4_obj_reward_object_parameters_MATERIAL": { "title": "Material", @@ -10155,10 +10181,16 @@ "parameters": { "description": "Defines the cost of the reward.", "type": "object", + "required": [ + "loyalty" + ], "properties": { "loyalty": { "type": "object", "description": "Defines the equivalent points value of the reward.", + "required": [ + "points" + ], "properties": { "points": { "type": "integer", @@ -10175,7 +10207,10 @@ "format": "date-time" }, "updated_at": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Timestamp representing the date and time when the reward assignment was updated in ISO 8601 format.", "example": "2022-08-11T16:01:34.885Z", "format": "date-time" @@ -10185,7 +10220,17 @@ "default": "reward_assignment", "description": "The type of object represented by the JSON. This object stores information about the reward assignment." } - } + }, + "required": [ + "id", + "reward_id", + "related_object_id", + "related_object_type", + "parameters", + "created_at", + "updated_at", + "object" + ] }, "4_res_list_reward_assignments": { "type": "object", @@ -22788,7 +22833,12 @@ "default": "loyalty_tier_reward", "description": "The type of object represented by JSON. This object stores information about the loyalty tier reward." } - } + }, + "required": [ + "reward", + "assignment", + "object" + ] }, "8_obj_loyalty_card_object_non_expanded_categories": { "title": "Loyalty Card Object", @@ -29514,7 +29564,13 @@ "type": "integer", "description": "Total number of loyalty tier reward objects." } - } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] }, "8_res_list_members": { "title": "List Members", @@ -39336,9 +39392,6 @@ }, "EarningRuleBase": { "title": "EarningRuleBase", - "x-stoplight": { - "id": "w4ci1ljqva0r1" - }, "type": "object", "properties": { "id": { @@ -39476,9 +39529,6 @@ }, "EarningRuleEvent": { "title": "EarningRuleEvent", - "x-stoplight": { - "id": "6vxql7fnzg2zp" - }, "type": "string", "enum": [ "order.paid", @@ -39493,9 +39543,6 @@ }, "EarningRuleFixed": { "title": "Define fixed amount of points", - "x-stoplight": { - "id": "r5o8m0sdli7fq" - }, "type": "object", "properties": { "type": { @@ -39527,9 +39574,6 @@ }, "EarningRuleProportionalOrderAmount": { "title": "Order Amount", - "x-stoplight": { - "id": "1z7lk7z1lp5af" - }, "type": "object", "properties": { "type": { @@ -39581,9 +39625,6 @@ }, "EarningRuleProportionalOrderTotalAmount": { "title": "Order Total Amount", - "x-stoplight": { - "id": "ekudxr430edgk" - }, "type": "object", "properties": { "type": { @@ -39635,9 +39676,6 @@ }, "EarningRuleProportionalOrderMetadata": { "title": "Order Metadata", - "x-stoplight": { - "id": "4ccw4gz8b47u5" - }, "type": "object", "properties": { "type": { @@ -39695,9 +39733,6 @@ }, "EarningRuleProportionalOrderItemsQuantity": { "title": "Order Items Quantity", - "x-stoplight": { - "id": "pqsn9otpzyot9" - }, "type": "object", "properties": { "type": { @@ -39764,9 +39799,6 @@ }, "EarningRuleProportionalOrderItemsAmount": { "title": "Order Items Amount", - "x-stoplight": { - "id": "8pg4o23daepkb" - }, "type": "object", "properties": { "type": { @@ -39833,9 +39865,6 @@ }, "EarningRuleProportionalOrderItemsSubtotalAmount": { "title": "Order Items Subtotal Amount", - "x-stoplight": { - "id": "duxy5qw36h5ph" - }, "type": "object", "properties": { "type": { @@ -39958,9 +39987,6 @@ }, "EarningRuleProportionalCustomEvent": { "title": "Custom Event", - "x-stoplight": { - "id": "jpkgjc35zrtxj" - }, "type": "object", "properties": { "type": { @@ -81846,4 +81872,4 @@ } } } -} +} \ No newline at end of file From 86c2247eb17423506c3cd10b133bca4e9ba4a244 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 13 Oct 2023 09:48:37 +0200 Subject: [PATCH 02/20] duplicated reward objects --- reference/OpenAPI.json | 323 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 289 insertions(+), 34 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 12499613c..7b2c3d0ba 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -9557,20 +9557,7 @@ "default": "reward", "description": "The type of object represented by the JSON. This object stores information about the reward." } - }, - "required": [ - "id", - "name", - "type", - "parameters", - "stock", - "redeemed", - "attributes", - "created_at", - "updated_at", - "metadata", - "object" - ] + } }, "4_obj_reward_object_parameters_CAMPAIGN": { "title": "Digital", @@ -9608,7 +9595,11 @@ "description": "Campaign type.", "default": "DISCOUNT_COUPONS" } - } + }, + "required": [ + "id", + "type" + ] }, "4_obj_reward_object_parameters_CAMPAIGN_GIFT_VOUCHERS": { "title": "Gift Vouchers", @@ -9629,7 +9620,12 @@ "description": "Campaign type.", "default": "GIFT_VOUCHERS" } - } + }, + "required": [ + "id", + "balance", + "type" + ] }, "4_obj_reward_object_parameters_CAMPAIGN_LOYALTY_PROGRAM": { "title": "Points on loyalty card", @@ -9650,7 +9646,12 @@ "description": "Campaign type.", "default": "LOYALTY_PROGRAM" } - } + }, + "required": [ + "id", + "balance", + "type" + ] }, "4_obj_reward_object_parameters_COIN": { "title": "Pay with Points", @@ -10220,17 +10221,7 @@ "default": "reward_assignment", "description": "The type of object represented by the JSON. This object stores information about the reward assignment." } - }, - "required": [ - "id", - "reward_id", - "related_object_id", - "related_object_type", - "parameters", - "created_at", - "updated_at", - "object" - ] + } }, "4_res_list_reward_assignments": { "type": "object", @@ -22814,7 +22805,7 @@ } } }, - "8_obj_loyalty_tier_reward_object": { + "loyalties_loyalty_tier_reward": { "title": "Loyalty Tier Reward Object", "type": "object", "description": "This is an object representing a loyalty tier reward.", @@ -22823,10 +22814,10 @@ ], "properties": { "reward": { - "$ref": "#/components/schemas/4_obj_reward_object" + "$ref": "#/components/schemas/loyalties_reward_item" }, "assignment": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + "$ref": "#/components/schemas/loyalties_reward_assignment_item" }, "object": { "type": "string", @@ -29538,7 +29529,7 @@ } } }, - "8_res_list_loyalty_tier_rewards": { + "loyalties_list_loyalty_tier_rewards_request_body": { "title": "List Loyalty Tier Rewards", "type": "object", "description": "Response schema for `/loyalties/{campaignId}/tiers/{tierId}/rewards`.", @@ -29557,7 +29548,7 @@ "type": "array", "description": "Contains array of loyalty tier reward objects.", "items": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_reward_object" + "$ref": "#/components/schemas/loyalties_loyalty_tier_reward" } }, "total": { @@ -40072,6 +40063,270 @@ ], "title": "Order Items" }, + "loyalties_reward_item": { + "title": "Reward Object", + "type": "object", + "description": "This is an object representing a reward.", + "x-tags": [ + "REWARDS API" + ], + "properties": { + "id": { + "type": "string", + "example": "rew_nIy4gHpQHle2c3pNMwuj7G6j", + "description": "Unique reward ID, assigned by Voucherify." + }, + "name": { + "type": "string", + "description": "Reward name." + }, + "type": { + "type": "string", + "enum": [ + "CAMPAIGN", + "COIN", + "MATERIAL" + ], + "description": "Reward type." + }, + "parameters": { + "description": "Defines how the reward is generated.", + "oneOf": [ + { + "$ref": "#/components/schemas/loyalties_reward_item_parameters_campaign" + }, + { + "$ref": "#/components/schemas/loyalties_reward_item_parameters_coin" + }, + { + "$ref": "#/components/schemas/loyalties_reward_item_parameters_material" + } + ] + }, + "stock": { + "type": [ + "integer", + "null" + ], + "description": "Configurable for **material rewards**. The number of units of the product that you want to share as reward." + }, + "redeemed": { + "type": [ + "integer", + "null" + ], + "description": "Defines the number of already invoked (successful) reward redemptions.\t" + }, + "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", + "description": "Timestamp representing the date and time when the reward was created in ISO 8601 format.", + "example": "2022-08-11T14:49:22.586Z", + "format": "date-time" + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "description": "Timestamp representing the date and time when the reward was updated in ISO 8601 format.", + "example": "2022-08-11T16:01:34.885Z", + "format": "date-time" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format." + }, + "object": { + "type": "string", + "default": "reward", + "description": "The type of object represented by the JSON. This object stores information about the reward." + } + }, + "required": [ + "id", + "name", + "type", + "parameters", + "stock", + "redeemed", + "attributes", + "created_at", + "updated_at", + "metadata", + "object" + ] + }, + "loyalties_reward_assignment_item": { + "title": "Reward Assignment Object", + "type": "object", + "description": "This is an object representing a reward assignment.", + "x-tags": [ + "REWARDS API" + ], + "properties": { + "id": { + "type": "string", + "example": "rewa_PbIRoMXpwe5QhobW4JKu0VjH", + "description": "Unique reward assignment ID, assigned by Voucherify." + }, + "reward_id": { + "type": "string", + "description": "Associated reward ID.", + "example": "rew_C7wS9eHFDN4CIbXI5PpLSkGY" + }, + "related_object_id": { + "type": "string", + "description": "Related object ID to which the reward was assigned.", + "example": "camp_wciTvaOfYmAa3EmIIW3QpXXZ" + }, + "related_object_type": { + "type": "string", + "description": "Related object type to which the reward was assigned.", + "example": "campaign" + }, + "parameters": { + "description": "Defines the cost of the reward.", + "type": "object", + "required": [ + "loyalty" + ], + "properties": { + "loyalty": { + "type": "object", + "description": "Defines the equivalent points value of the reward.", + "required": [ + "points" + ], + "properties": { + "points": { + "type": "integer", + "description": "The number of points required to redeem the reward." + } + } + } + } + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the reward assignment was created in ISO 8601 format.", + "example": "2022-08-11T14:49:22.586Z", + "format": "date-time" + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "description": "Timestamp representing the date and time when the reward assignment was updated in ISO 8601 format.", + "example": "2022-08-11T16:01:34.885Z", + "format": "date-time" + }, + "object": { + "type": "string", + "default": "reward_assignment", + "description": "The type of object represented by the JSON. This object stores information about the reward assignment." + } + }, + "required": [ + "id", + "reward_id", + "related_object_id", + "related_object_type", + "parameters", + "created_at", + "updated_at", + "object" + ] + }, + "loyalties_reward_item_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" + } + ] + } + } + }, + "loyalties_reward_item_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" + ] + }, + "loyalties_reward_item_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.", + "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" + } + } + } + } + }, "a_req_importCSV": { "type": "object", "title": "Import CSV file", @@ -71779,7 +72034,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_list_loyalty_tier_rewards" + "$ref": "#/components/schemas/loyalties_list_loyalty_tier_rewards_request_body" }, "examples": { "Example": { From a19d77c54562156aa59f261504fc31122c2d21c1 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 13 Oct 2023 14:06:59 +0200 Subject: [PATCH 03/20] Update OpenAPI.json --- reference/OpenAPI.json | 4542 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 4153 insertions(+), 389 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 7b2c3d0ba..dae42e817 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -9506,17 +9506,11 @@ "description": "Defines how the reward is generated." }, "stock": { - "type": [ - "integer", - "null" - ], + "type": "integer", "description": "Configurable for **material rewards**. The number of units of the product that you want to share as reward." }, "redeemed": { - "type": [ - "integer", - "null" - ], + "type": "integer", "description": "Defines the number of already invoked (successful) reward redemptions.\t" }, "attributes": { @@ -9595,11 +9589,7 @@ "description": "Campaign type.", "default": "DISCOUNT_COUPONS" } - }, - "required": [ - "id", - "type" - ] + } }, "4_obj_reward_object_parameters_CAMPAIGN_GIFT_VOUCHERS": { "title": "Gift Vouchers", @@ -9620,12 +9610,7 @@ "description": "Campaign type.", "default": "GIFT_VOUCHERS" } - }, - "required": [ - "id", - "balance", - "type" - ] + } }, "4_obj_reward_object_parameters_CAMPAIGN_LOYALTY_PROGRAM": { "title": "Points on loyalty card", @@ -9646,12 +9631,7 @@ "description": "Campaign type.", "default": "LOYALTY_PROGRAM" } - }, - "required": [ - "id", - "balance", - "type" - ] + } }, "4_obj_reward_object_parameters_COIN": { "title": "Pay with Points", @@ -9661,10 +9641,6 @@ "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", @@ -9676,10 +9652,7 @@ } } } - }, - "required": [ - "coin" - ] + } }, "4_obj_reward_object_parameters_MATERIAL": { "title": "Material", @@ -10182,16 +10155,10 @@ "parameters": { "description": "Defines the cost of the reward.", "type": "object", - "required": [ - "loyalty" - ], "properties": { "loyalty": { "type": "object", "description": "Defines the equivalent points value of the reward.", - "required": [ - "points" - ], "properties": { "points": { "type": "integer", @@ -10208,10 +10175,7 @@ "format": "date-time" }, "updated_at": { - "type": [ - "string", - "null" - ], + "type": "string", "description": "Timestamp representing the date and time when the reward assignment was updated in ISO 8601 format.", "example": "2022-08-11T16:01:34.885Z", "format": "date-time" @@ -22805,7 +22769,7 @@ } } }, - "loyalties_loyalty_tier_reward": { + "8_obj_loyalty_tier_reward_object": { "title": "Loyalty Tier Reward Object", "type": "object", "description": "This is an object representing a loyalty tier reward.", @@ -22814,22 +22778,17 @@ ], "properties": { "reward": { - "$ref": "#/components/schemas/loyalties_reward_item" + "$ref": "#/components/schemas/4_obj_reward_object" }, "assignment": { - "$ref": "#/components/schemas/loyalties_reward_assignment_item" + "$ref": "#/components/schemas/4_obj_reward_assignment_object" }, "object": { "type": "string", "default": "loyalty_tier_reward", "description": "The type of object represented by JSON. This object stores information about the loyalty tier reward." } - }, - "required": [ - "reward", - "assignment", - "object" - ] + } }, "8_obj_loyalty_card_object_non_expanded_categories": { "title": "Loyalty Card Object", @@ -29529,7 +29488,7 @@ } } }, - "loyalties_list_loyalty_tier_rewards_request_body": { + "8_res_list_loyalty_tier_rewards": { "title": "List Loyalty Tier Rewards", "type": "object", "description": "Response schema for `/loyalties/{campaignId}/tiers/{tierId}/rewards`.", @@ -29548,20 +29507,14 @@ "type": "array", "description": "Contains array of loyalty tier reward objects.", "items": { - "$ref": "#/components/schemas/loyalties_loyalty_tier_reward" + "$ref": "#/components/schemas/8_obj_loyalty_tier_reward_object" } }, "total": { "type": "integer", "description": "Total number of loyalty tier reward objects." } - }, - "required": [ - "object", - "data_ref", - "data", - "total" - ] + } }, "8_res_list_members": { "title": "List Members", @@ -33301,6 +33254,91 @@ } } }, + "product_collections_product_in_collection": { + "type": "object", + "description": "This is an object representing a product in product collection.", + "title": "Product in Collection", + "properties": { + "id": { + "type": "string", + "description": "Unique product ID.", + "example": "prod_f1r5Tpr0DuC7" + }, + "source_id": { + "type": [ + "string", + "null" + ], + "example": "productSourceID16", + "description": "Unique product source ID." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "Unique user-defined product name.", + "example": "T-shirt" + }, + "price": { + "type": [ + "integer", + "null" + ], + "description": "Product unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "attributes": { + "type": "array", + "description": "A list of product attributes whose values you can customize for given SKUs: `[\"color\",\"size\",\"ranking\"]`. Each child SKU can have a unique value for a given attribute.", + "items": { + "type": "string" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the product. A set of key/value pairs that you can attach to a product object. It can be useful for storing additional information about the product in a structured format." + }, + "image_url": { + "type": [ + "string", + "null" + ], + "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the product image.", + "example": "https://images.com/original.jpg" + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the product was created in ISO 8601 format.", + "example": "2022-05-23T06:52:55.008Z", + "format": "date-time" + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "description": "Timestamp representing the date and time when the product was updated in ISO 8601 format.", + "example": "2022-05-23T09:24:07.405Z" + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about the `product`.", + "default": "product" + } + }, + "required": [ + "id", + "source_id", + "name", + "price", + "attributes", + "metadata", + "image_url", + "created_at", + "updated_at", + "object" + ] + }, "11_obj_product_object_truncated": { "type": "object", "description": "This is an object representing a product.", @@ -33486,10 +33524,10 @@ } } }, - "11_obj_sku_object_extended": { - "title": "SKU Object", + "product_collections_sku_in_collection": { + "title": "SKU in Collection", "type": "object", - "description": "Response body schema for **GET** `/product-collections/{productCollectionID}/products`.", + "description": "This is an object representing a SKU in product collection.", "properties": { "id": { "type": "string", @@ -33497,7 +33535,10 @@ "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, "source_id": { - "type": "string", + "type": [ + "string", + "null" + ], "example": "sku_source_id_4", "description": "A unique SKU identifier from your inventory system." }, @@ -33507,12 +33548,18 @@ "description": "The parent product's unique ID." }, "sku": { - "type": "string", + "type": [ + "string", + "null" + ], "example": "Large Pink Shirt", "description": "Unique user-defined SKU name." }, "price": { - "type": "integer", + "type": [ + "integer", + "null" + ], "description": "SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, "attributes": { @@ -33520,7 +33567,10 @@ "description": "The attributes object stores values for all custom attributes inherited by the SKU from the parent product. A set of key/value pairs that are attached to a SKU object and are unique to each SKU within a product family." }, "image_url": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." }, "metadata": { @@ -33534,7 +33584,10 @@ "format": "date-time" }, "updated_at": { - "type": "string", + "type": [ + "string", + "null" + ], "example": "2022-05-17T10:55:09.137Z", "description": "Timestamp representing the date and time when the SKU was updated in ISO 8601 format.", "format": "date-time" @@ -33547,6 +33600,15 @@ "product": { "type": "object", "description": "Stores information about the parent product.", + "required": [ + "id", + "source_id", + "name", + "price", + "attributes", + "metadata", + "object" + ], "properties": { "id": { "type": "string", @@ -33554,17 +33616,26 @@ "description": "Unique product ID." }, "source_id": { - "type": "string", + "type": [ + "string", + "null" + ], "example": "productSourceID11", "description": "A unique product ID from your inventory system." }, "name": { - "type": "string", + "type": [ + "string", + "null" + ], "example": "Shirts", "description": "Unique user-defined product name." }, "price": { - "type": "integer", + "type": [ + "integer", + "null" + ], "description": "Product unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, "attributes": { @@ -33585,7 +33656,21 @@ } } } - } + }, + "required": [ + "id", + "source_id", + "product_id", + "sku", + "price", + "attributes", + "image_url", + "metadata", + "created_at", + "updated_at", + "object", + "product" + ] }, "11_req_update_sku": { "title": "Update SKU Request Body", @@ -33619,7 +33704,7 @@ } } }, - "11_res_product-collections_productCollectionID_products": { + "product_collections_list_products_response_body": { "type": "object", "description": "Response body schema for **GET** `/product-collections/{productCollectionID}/products`.", "title": "List Products in Collection Response Body", @@ -33640,10 +33725,10 @@ "items": { "oneOf": [ { - "$ref": "#/components/schemas/11_obj_product_object_truncated" + "$ref": "#/components/schemas/product_collections_product_in_collection" }, { - "$ref": "#/components/schemas/11_obj_sku_object_extended" + "$ref": "#/components/schemas/product_collections_sku_in_collection" } ] } @@ -33652,7 +33737,13 @@ "type": "integer", "description": "Total number of products & SKUs in the product collection." } - } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] }, "11_res_products_productId_skus": { "type": "object", @@ -33682,47 +33773,20 @@ } } }, - "12_obj_product_collection_object": { - "title": "Product Collection Object", - "description": "This is an object representing a product collection. \n\nThe products can be grouped into collections by the creation of a products collection object. You can retrieve a product collection and a list of products in the collection. Product collections are identified by a unique ID.", - "x-tags": [ - "PRODUCT COLLECTIONS API" - ], - "oneOf": [ - { - "$ref": "#/components/schemas/12_obj_product-collections_static" - }, - { - "$ref": "#/components/schemas/12_obj_product-collections_auto_update" - } - ] - }, - "12_obj_product-collections_static": { + "product_collections_static_collection": { "type": "object", "title": "Static Product Collection", "description": "Schema model for a `STATIC` product collection.", "properties": { - "id": { - "type": "string", - "description": "Product collection ID.", - "example": "pc_a11pr0dUc75" - }, - "name": { - "type": "string", - "example": "All Products", - "description": "Unique user-defined product collection name." - }, "type": { - "type": "string", + "description": "Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products).", "enum": [ - "AUTO_UPDATE", "STATIC" - ], - "description": "Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products)." + ] }, "products": { - "type": "array", "description": "Defines a set of products for a `STATIC` product collection type.", + "type": "array", "items": { "type": "object", "properties": { @@ -33731,80 +33795,97 @@ "example": "prod_0a41bcf807c5fcaaf6", "description": "The product ID." }, - "object": { + "product_id": { "type": "string", - "default": "product", + "description": "Product ID for SKUs." + }, + "object": { + "enum": [ + "sku", + "product" + ], "description": "Denotes the type of object represented by the ID." } - } + }, + "required": [ + "id", + "object" + ] } - }, - "created_at": { - "type": "string", - "example": "2021-12-09T12:51:29.898Z", - "description": "Timestamp representing the date and time when the product collection was created in ISO 8601 format.", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-04-08T04:56:41.142Z", - "description": "Timestamp representing the date and time when the product collection was updated in ISO 8601 format.", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "products_collection", - "description": "The type of object represented by JSON. This object stores information about the static product collection." } - } + }, + "required": [ + "type", + "products" + ] }, - "12_obj_product-collections_auto_update": { + "product_collections_dynamic_collection": { "type": "object", "title": "Dynamic Product Collection", "description": "Schema model for an `AUTO_UPDATE` product collection.", "properties": { - "id": { - "type": "string", - "description": "Product collection ID.", - "example": "pc_a11pr0dUc75" - }, - "name": { - "type": "string", - "example": "All Products", - "description": "Unique user-defined product collection name." - }, "type": { - "type": "string", + "description": "Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products).", "enum": [ - "AUTO_UPDATE", - "STATIC" - ], - "description": "Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products)." + "AUTO_UPDATE" + ] }, "filter": { "type": "object", - "description": "Defines a set of criteria and boundary conditions for an `AUTO_UPDATE` product collection type." - }, - "created_at": { - "type": "string", - "example": "2021-12-09T12:51:29.898Z", - "description": "Timestamp representing the date and time when the product collection was created in ISO 8601 format.", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-04-08T04:56:41.142Z", - "description": "Timestamp representing the date and time when the product collection was updated in ISO 8601 format.", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "products_collection", - "description": "The type of object represented by JSON. This object stores information about the dynamic product collection." + "description": "Defines a set of criteria and boundary conditions for an `AUTO_UPDATE` product collection type.", + "additionalProperties": false, + "required": [ + "junction" + ], + "properties": { + "junction": { + "$ref": "#/components/schemas/Junction" + }, + "id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "product_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "source_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "name": { + "$ref": "#/components/schemas/FieldConditions" + }, + "price": { + "$ref": "#/components/schemas/FieldConditions" + }, + "object": { + "$ref": "#/components/schemas/FieldConditions" + }, + "attributes": { + "$ref": "#/components/schemas/FieldConditions" + }, + "metadata": { + "$ref": "#/components/schemas/FieldConditions" + }, + "image_url": { + "$ref": "#/components/schemas/FieldConditions" + }, + "skus": { + "$ref": "#/components/schemas/FieldConditions" + }, + "created_at": { + "$ref": "#/components/schemas/FieldConditions" + }, + "updated_at": { + "$ref": "#/components/schemas/FieldConditions" + } + } } - } + }, + "required": [ + "type", + "filter" + ] }, - "12_res_product-collections": { + "product_collections_list_response_body": { "type": "object", "title": "List Product Collections Response Body", "description": "Response body schema for **GET** `/product-collections`.", @@ -33823,14 +33904,20 @@ "description": "A dictionary that contains an array of product collections and their details.", "type": "array", "items": { - "$ref": "#/components/schemas/12_obj_product_collection_object" + "$ref": "#/components/schemas/product_collections_collection_item" } }, "total": { "type": "integer", "description": "Total number of product collections." } - } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] }, "13_obj_validation_rule_object": { "title": "Validation Rule Object", @@ -39287,42 +39374,112 @@ } } }, - "LoyaltiesGetEarningRuleResponseBody": { - "allOf": [ - { - "$ref": "#/components/schemas/EarningRuleBase" + "LoyaltiesGetPointsExpirationResponseBody": { + "title": "Loyalties Get Points Expiration Response Body", + "type": "object", + "properties": { + "object": { + "type": "string", + "pattern": "list", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about loyalty points expiration buckets in a dictionary." }, - { - "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." + "data_ref": { + "type": "string", + "pattern": "data", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of loyalty points expiration bucket objects." + }, + "data": { + "type": "array", + "description": "Contains array of loyalty points expiration buckets.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique loyalty points bucket ID." + }, + "voucher_id": { + "type": "string", + "description": "Unique parent loyalty card ID." + }, + "campaign_id": { + "type": "string", + "description": "\nUnique parent campaign ID." + }, + "bucket": { + "type": "object", + "required": [ + "total_points" + ], + "description": "Defines the number of points stored in the given loyalty points bucket.", + "properties": { + "total_points": { + "type": "integer", + "description": "Total number of points in the loyalty points bucket." + } + } + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the loyalty points bucket object was created in ISO 8601 format.", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Loyalty points bucket point status." + }, + "expires_at": { + "type": "string", + "format": "date-time", + "description": "Date when the number of points defined in the bucket object are due to expire." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the loyalty points bucket object was updated in ISO 8601 format." + }, + "object": { + "type": "string", + "pattern": "loyalty_points_bucket", + "enum": [ + "loyalty_points_bucket" + ], + "description": "The type of object represented by JSON. This object stores information about the loyalty points bucket." + } }, - "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" - ] + "required": [ + "id", + "voucher_id", + "campaign_id", + "bucket", + "created_at", + "status", + "expires_at", + "object" + ] + } + }, + "total": { + "type": "integer", + "description": "Total number of point expiration buckets." } + }, + "required": [ + "object", + "data_ref", + "data", + "total" ] }, + "LoyaltiesGetEarningRuleResponseBody": { + "$ref": "#/components/schemas/EarningRule" + }, "LoyaltiesEnableEarningRulesResponseBody": { "allOf": [ { @@ -39383,6 +39540,9 @@ }, "EarningRuleBase": { "title": "EarningRuleBase", + "x-stoplight": { + "id": "w4ci1ljqva0r1" + }, "type": "object", "properties": { "id": { @@ -39520,6 +39680,9 @@ }, "EarningRuleEvent": { "title": "EarningRuleEvent", + "x-stoplight": { + "id": "6vxql7fnzg2zp" + }, "type": "string", "enum": [ "order.paid", @@ -39534,6 +39697,9 @@ }, "EarningRuleFixed": { "title": "Define fixed amount of points", + "x-stoplight": { + "id": "r5o8m0sdli7fq" + }, "type": "object", "properties": { "type": { @@ -39565,6 +39731,9 @@ }, "EarningRuleProportionalOrderAmount": { "title": "Order Amount", + "x-stoplight": { + "id": "1z7lk7z1lp5af" + }, "type": "object", "properties": { "type": { @@ -39616,6 +39785,9 @@ }, "EarningRuleProportionalOrderTotalAmount": { "title": "Order Total Amount", + "x-stoplight": { + "id": "ekudxr430edgk" + }, "type": "object", "properties": { "type": { @@ -39667,6 +39839,9 @@ }, "EarningRuleProportionalOrderMetadata": { "title": "Order Metadata", + "x-stoplight": { + "id": "4ccw4gz8b47u5" + }, "type": "object", "properties": { "type": { @@ -39724,6 +39899,9 @@ }, "EarningRuleProportionalOrderItemsQuantity": { "title": "Order Items Quantity", + "x-stoplight": { + "id": "pqsn9otpzyot9" + }, "type": "object", "properties": { "type": { @@ -39790,6 +39968,9 @@ }, "EarningRuleProportionalOrderItemsAmount": { "title": "Order Items Amount", + "x-stoplight": { + "id": "8pg4o23daepkb" + }, "type": "object", "properties": { "type": { @@ -39856,6 +40037,9 @@ }, "EarningRuleProportionalOrderItemsSubtotalAmount": { "title": "Order Items Subtotal Amount", + "x-stoplight": { + "id": "duxy5qw36h5ph" + }, "type": "object", "properties": { "type": { @@ -40063,270 +40247,3594 @@ ], "title": "Order Items" }, - "loyalties_reward_item": { - "title": "Reward Object", + "LoyaltiesListMemberRewardsRequestQuery": { + "title": "Loyalties List Member Rewards Request Query", "type": "object", - "description": "This is an object representing a reward.", - "x-tags": [ - "REWARDS API" - ], "properties": { - "id": { - "type": "string", - "example": "rew_nIy4gHpQHle2c3pNMwuj7G6j", - "description": "Unique reward ID, assigned by Voucherify." + "affordable_only": { + "type": "string" }, - "name": { + "limit": { + "type": "integer" + }, + "page": { + "type": "integer" + } + } + }, + "LoyaltiesGetPointsExpirationRequestQuery": { + "title": "Loyalties Get Points Expiration Request Query", + "type": "object", + "properties": { + "limit": { + "type": "integer", + "minimum": 1, + "multipleOf": 100 + }, + "page": { + "type": "integer" + } + } + }, + "LoyaltiesListCardTransactionsRequestQuery": { + "title": "Loyalties List Card Transactions Request Query", + "type": "object", + "properties": { + "limit": { + "type": "integer", + "minimum": 1, + "multipleOf": 100 + }, + "page": { + "type": "integer" + } + } + }, + "LoyaltiesListCardTransactionsResponseBody": { + "title": "Loyalties List Card Transactions Response Body", + "type": "object", + "properties": { + "object": { "type": "string", - "description": "Reward name." + "pattern": "list", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON." }, - "type": { + "data_ref": { "type": "string", + "pattern": "data", "enum": [ - "CAMPAIGN", - "COIN", - "MATERIAL" + "data" ], - "description": "Reward type." + "description": "Identifies the name of the attribute that contains the array of transaction objects." }, - "parameters": { - "description": "Defines how the reward is generated.", - "oneOf": [ - { - "$ref": "#/components/schemas/loyalties_reward_item_parameters_campaign" + "data": { + "type": "array", + "description": "A dictionary that contains an array of transactions. Each entry in the array is a separate transaction object.", + "items": { + "$ref": "#/components/schemas/LoyaltyCardTransaction" + } + }, + "has_more": { + "type": "boolean", + "description": "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." + } + }, + "required": [ + "object", + "data_ref", + "data", + "has_more" + ] + }, + "LoyaltyCardTransactionsType": { + "type": "string", + "enum": [ + "POINTS_ACCRUAL", + "POINTS_CANCELLATION", + "POINTS_REDEMPTION", + "POINTS_REFUND", + "POINTS_ADDITION", + "POINTS_REMOVAL", + "POINTS_EXPIRATION", + "POINTS_TRANSFER_IN", + "POINTS_TRANSFER_OUT" + ] + }, + "SimpleLoyaltyVoucher": { + "title": "Simple Loyalty Voucher", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "code": { + "type": "string" + }, + "loyalty_card": { + "type": "object", + "required": [ + "points", + "balance" + ], + "properties": { + "points": { + "type": "string" }, - { - "$ref": "#/components/schemas/loyalties_reward_item_parameters_coin" + "balance": { + "type": "string" }, - { - "$ref": "#/components/schemas/loyalties_reward_item_parameters_material" + "next_expiration_date": { + "type": "string" + }, + "next_expiration_points": { + "type": "string" } + } + }, + "type": { + "type": "string", + "enum": [ + "LOYALTY_CARD" ] }, - "stock": { + "campaign": { + "type": "string" + }, + "campaign_id": { + "type": "string" + }, + "is_referral_code": { + "type": "boolean" + }, + "holder_id": { + "type": "string" + }, + "referrer_id": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "object": { + "type": "string", + "pattern": "voucher", + "enum": [ + "voucher" + ] + } + }, + "required": [ + "id", + "code", + "loyalty_card", + "type", + "campaign", + "campaign_id", + "object" + ] + }, + "LoyaltyCardTransaction": { + "title": "Loyalty Card Transaction", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID." + }, + "source_id": { "type": [ - "integer", + "string", "null" ], - "description": "Configurable for **material rewards**. The number of units of the product that you want to share as reward." + "description": "The merchant’s transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service. In case of a redemption, this value is null." }, - "redeemed": { + "voucher_id": { + "type": "string", + "description": "Unique voucher ID." + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes." + }, + "source": { "type": [ - "integer", + "string", "null" ], - "description": "Defines the number of already invoked (successful) reward redemptions.\t" + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a redemption, this value is null." }, - "attributes": { + "reason": { + "type": [ + "string", + "null" + ], + "description": "Reason why the transaction occurred. In case of a redemption, this value is null." + }, + "type": { + "$ref": "#/components/schemas/LoyaltyCardTransactionsType", + "description": "Type of transaction." + }, + "details": { "type": "object", - "description": "These properties are configurable for **material rewards**.", + "description": "Contains the detailed information about the transaction.", "properties": { - "image_url": { - "type": "string", - "description": "The HTTPS URL pointing to the .png or .jpg file." + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "pattern": "loyalty_card", + "enum": [ + "loyalty_card" + ], + "description": "The type of voucher whose balance is being adjusted due to the transaction." + }, + "total": { + "type": "integer", + "description": "The available points prior to the transaction." + }, + "object": { + "type": "string", + "pattern": "balance", + "enum": [ + "balance" + ], + "description": "The type of object represented by the JSON." + }, + "points": { + "type": "integer", + "description": "The amount of points being used up in the transaction." + }, + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are subtracted from the loyalty card." + }, + "related_object": { + "type": "object", + "required": [ + "id", + "type" + ], + "description": "Defines the resource that is being modified with the values that are returned in the balance object.", + "properties": { + "id": { + "type": "string", + "description": "Identifies the voucher that is being modified, this is the ID that was assigned by the Voucherify API." + }, + "type": { + "type": "string", + "pattern": "voucher", + "enum": [ + "voucher" + ], + "description": "The object being modified, i.e. voucher." + } + } + } + }, + "required": [ + "type", + "total", + "object", + "points", + "balance", + "related_object" + ] }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a material reward." + "order": { + "type": "object", + "description": "Contains information about the original order.", + "properties": { + "id": { + "type": "string", + "description": "Unique order ID." + }, + "source_id": { + "type": "string", + "description": "The merchant’s order ID if it is different from the Voucherify order ID. It is really useful in case of integration between multiple systems. It can be an order ID from CRM, database or 3rd party service." + } + }, + "required": [ + "id", + "source_id" + ] + }, + "event": { + "type": "object", + "description": "Contains information about the event that triggers the point accrual.", + "properties": { + "id": { + "type": "string", + "description": "Unique event ID." + }, + "type": { + "type": "string", + "description": "Type of event." + } + }, + "required": [ + "id", + "type" + ] + }, + "earning_rule": { + "type": "object", + "description": "Contains information about the earning rule.", + "properties": { + "id": { + "type": "string", + "description": "Unique earning rule ID." + }, + "source": { + "type": "object", + "required": [ + "banner" + ], + "description": "Contains the custom earning rule name.", + "properties": { + "banner": { + "type": "string", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + } + } + } + }, + "required": [ + "id", + "source" + ] + }, + "segment": { + "type": "object", + "description": "Contains information about the segment.", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ] + }, + "loyalty_tier": { + "type": "object", + "description": "Contains information about the loyalty tier.", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "id", + "name" + ] + }, + "redemption": { + "type": "object", + "description": "Contains information about the original redemption.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption ID." + } + }, + "required": [ + "id" + ] + }, + "rollback": { + "type": "object", + "description": "Contains information about the redemption rollback.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption rollback ID." + } + }, + "required": [ + "id" + ] + }, + "custom_event": { + "type": "object", + "description": "Contains information about the custom event that triggers the point accrual.", + "properties": { + "id": { + "type": "string", + "description": "Unique event ID." + }, + "type": { + "type": "string", + "description": "Type of custom event." + } + }, + "required": [ + "id", + "type" + ] + }, + "event_schema": { + "type": "object", + "description": "Contains information about the custom event metadata schema.", + "properties": { + "id": { + "type": "string", + "description": "Unique metadata schema ID." + }, + "name": { + "type": "string", + "description": "Type of custom event." + } + }, + "required": [ + "id", + "name" + ] + }, + "reward": { + "type": "object", + "description": "Contains information about the pay with points reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID." + }, + "name": { + "type": "string", + "description": "Reward name." + } + }, + "required": [ + "id", + "name" + ] + }, + "source_voucher": { + "$ref": "#/components/schemas/SimpleLoyaltyVoucher", + "description": "Contains information on how the balance on the donor loyalty card was affected by the transaction." + }, + "destination_voucher": { + "$ref": "#/components/schemas/SimpleLoyaltyVoucher", + "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction." } } }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the reward was created in ISO 8601 format.", - "example": "2022-08-11T14:49:22.586Z", - "format": "date-time" - }, - "updated_at": { + "related_transaction_id": { "type": [ "string", "null" ], - "description": "Timestamp representing the date and time when the reward was updated in ISO 8601 format.", - "example": "2022-08-11T16:01:34.885Z", - "format": "date-time" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format." + "description": "The related transaction ID on the receiving card." }, - "object": { + "created_at": { "type": "string", - "default": "reward", - "description": "The type of object represented by the JSON. This object stores information about the reward." + "format": "date-time", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format.\n\n" } }, "required": [ "id", - "name", + "source_id", + "voucher_id", + "campaign_id", + "source", + "reason", "type", - "parameters", - "stock", - "redeemed", - "attributes", - "created_at", - "updated_at", - "metadata", - "object" + "details", + "related_transaction_id", + "created_at" + ] + }, + "LoyaltyCardTransactionsFields": { + "type": "string", + "enum": [ + "id", + "campaign_id", + "voucher_id", + "type", + "source_id", + "reason", + "source", + "balance", + "amount", + "related_transaction_id", + "created_at", + "details" + ] + }, + "LoyaltiesExportCardTransactionsRequestBody": { + "title": "Loyalties Export Card Transactions Request Body", + "type": "object", + "properties": { + "order": { + "type": "string", + "enum": [ + "created_at", + "-created_at" + ], + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/LoyaltyCardTransactionsFields" + } + } + } + }, + "LoyaltiesExportCardTransactionsResponseBody": { + "title": "Loyalties Export Card Transactions Response Body", + "type": "object", + "description": "", + "properties": { + "id": { + "type": "string", + "description": "Unique export ID." + }, + "object": { + "type": "string", + "pattern": "export", + "enum": [ + "export" + ], + "description": "The type of object being represented. This object stores information about the export." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", + "format": "date-time" + }, + "status": { + "type": "string", + "pattern": "SCHEDULED", + "enum": [ + "SCHEDULED" + ], + "description": "Status of the export. Informs you whether the export has already been completed, i.e. indicates whether the file containing the exported data has been generated." + }, + "channel": { + "type": "string", + "description": "The channel through which the export was triggered." + }, + "exported_object": { + "type": "string", + "pattern": "voucher_transactions", + "enum": [ + "voucher_transactions" + ], + "description": "The type of exported object." + }, + "parameters": { + "type": "object", + "required": [ + "filters" + ], + "description": "List of available fields and filters that can be exported with loyalty card transactions along with the sorting order of the returned data.", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.\n\n`id`, `campaign_id`, `voucher_id`, `type`, `source_id`, `reason`, `source`, `balance`, `amount`, `related_transaction_id`, `created_at`, `details`", + "items": { + "$ref": "#/components/schemas/LoyaltyCardTransactionsFields" + } + }, + "filters": { + "type": "object", + "required": [ + "voucher_id" + ], + "description": "Filter condition.", + "properties": { + "voucher_id": { + "type": "object", + "required": [ + "conditions" + ], + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "required": [ + "$in" + ], + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$in": { + "type": "array", + "minItems": 1, + "maxItems": 1, + "items": { + "type": "string", + "minLength": 1, + "maxLength": 1 + } + } + } + } + } + } + } + } + } + }, + "result": { + "type": "null", + "description": "Contains the URL of the CSV file." + }, + "user_id": { + "type": [ + "string", + "null" + ], + "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the channel value is WEBSITE." + } + }, + "required": [ + "id", + "object", + "created_at", + "status", + "channel", + "exported_object", + "parameters", + "result", + "user_id" + ] + }, + "RewardAssignment": { + "title": "Reward Assignment", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique reward assignment ID, assigned by Voucherify." + }, + "reward_id": { + "type": "string", + "description": "Associated reward ID." + }, + "related_object_id": { + "type": "string", + "description": "Related object ID to which the reward was assigned." + }, + "related_object_type": { + "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", + "description": "The number of points required to redeem the reward." + } + }, + "required": [ + "points" + ] + } + } + }, + "created_at": { + "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", + "description": "Timestamp representing the date and time when the reward assignment was updated in ISO 8601 format.", + "format": "date-time" + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the reward assignment." + } + }, + "required": [ + "id", + "reward_id", + "created_at", + "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": { + "title": "Reward Type", + "anyOf": [ + { + "$ref": "#/components/schemas/RewardTypeCampaign" + }, + { + "$ref": "#/components/schemas/RewardTypeCoin" + }, + { + "$ref": "#/components/schemas/RewardTypeCoin" + } + ] + }, + "RewardTypeCoin": { + "title": "Reward Type Coin", + "type": "object", + "properties": { + "type": { + "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", + "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": [ + "type", + "parameters" + ] + }, + "RewardTypeMaterial": { + "title": "Reward Type Material", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "MATERIAL" + ], + "description": "Reward type." + }, + "parameters": { + "type": "object", + "required": [ + "product" + ], + "description": "Defines how the reward is generated.", + "properties": { + "product": { + "type": "object", + "required": [ + "id", + "sku" + ], + "description": "Contains information about the product given as a reward.", + "properties": { + "id": { + "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." + } + } + } + } + } + }, + "required": [ + "type", + "parameters" + ] + }, + "RewardTypeCampaign": { + "title": "Reward Type Campaign", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "CAMPAIGN" + ], + "description": "Reward type." + }, + "parameters": { + "type": "object", + "required": [ + "campaign" + ], + "description": "Defines how the reward is generated.", + "properties": { + "campaign": { + "type": "object", + "required": [ + "id", + "type" + ], + "description": "Objects stores information about the campaign related to the reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify." + }, + "balance": { + "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", + "enum": [ + "DISCOUNT_COUPONS", + "PROMOTION", + "GIFT_VOUCHERS", + "REFERRAL_PROGRAM" + ], + "description": "Campaign type." + } + } + } + } + } + }, + "required": [ + "type", + "parameters" + ] + }, + "LoyaltiesAddOrRemoveCardBalanceResponseBody": { + "title": "Loyalties Add Or Remove Card Balance Response Body", + "type": "object", + "description": "Response schema for adding or removing points from a loyalty card.", + "properties": { + "points": { + "type": "integer", + "description": "The incremental points removed or added to the current balance on the loyalty card." + }, + "total": { + "type": "integer", + "description": "The total of points accrued over the lifetime of the loyalty card." + }, + "balance": { + "type": "integer", + "minimum": 0, + "description": "The balance after adding/removing points." + }, + "type": { + "type": "string", + "enum": [ + "LOYALTY_CARD", + "GIFT_VOUCHER" + ], + "description": "The type of voucher being modified." + }, + "object": { + "type": "string", + "pattern": "balance", + "enum": [ + "balance" + ], + "description": "The type of object represented by JSON. Default is balance." + }, + "related_object": { + "type": "object", + "required": [ + "type", + "id" + ], + "description": "Defines the object that is being modified with the values that are returned in the balance object.", + "properties": { + "type": { + "type": "string", + "enum": [ + "voucher" + ], + "description": "The object being modified." + }, + "id": { + "type": "string", + "description": "Identifies the loyalty card that is being modified, this is the ID that was assigned by the Voucherify API." + } + } + }, + "operation_type": { + "type": "string", + "enum": [ + "MANUAL", + "AUTOMATIC" + ] + } + }, + "required": [ + "points", + "total", + "balance", + "type", + "object", + "related_object" + ] + }, + "LoyaltiesTransferPointsResponseBody": { + "title": "Loyalties Transfer Points Response Body", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Assigned by the Voucherify API, identifies the voucher." + }, + "code": { + "type": "string", + "description": "A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters." + }, + "campaign": { + "type": "string", + "description": "A unique campaign name, identifies the voucher's parent campaign." + }, + "campaign_id": { + "type": "string", + "description": "Assigned by the Voucherify API, identifies the voucher's parent campaign." + }, + "category": { + "type": [ + "string", + "null" + ], + "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint." + }, + "category_id": { + "type": [ + "string", + "null" + ], + "description": "Unique category ID assigned by Voucherify." + }, + "categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Category" + } + }, + "type": { + "type": "string", + "enum": [ + "LOYALTY_CARD" + ], + "description": "Defines the type of voucher." + }, + "loyalty_card": { + "type": "object", + "description": "Object representing loyalty card parameters. Child attributes are present only if type is LOYALTY_CARD.", + "required": [ + "points", + "balance" + ], + "properties": { + "points": { + "type": "integer", + "description": "Total points incurred over lifespan of loyalty card." + }, + "balance": { + "type": "integer", + "description": "Points available for reward redemption." + }, + "next_expiration_date": { + "type": "string", + "description": "The next closest date when the next set of points are due to expire." + }, + "next_expiration_points": { + "type": "integer", + "description": "The amount of points that are set to expire next." + } + } + }, + "start_date": { + "type": [ + "string", + "null" + ], + "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is inactive before this date.", + "format": "date-time" + }, + "expiration_date": { + "type": [ + "string", + "null" + ], + "description": "Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is inactive after this date.", + "format": "date-time" + }, + "validity_timeframe": { + "type": [ + "object", + "null" + ], + "description": "Set recurrent time periods when the voucher 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 amount of time the voucher will be active in ISO 8601 format. For example, a voucher with a duration of PT1H will be valid for a duration of one hour." + }, + "duration": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a voucher with an interval of P2D will be active every other day." + } + } + }, + "validity_day_of_week": { + "type": [ + "array", + "null" + ], + "description": "Integer array corresponding to the particular days of the week in which the voucher 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", + "minimum": 0, + "maximum": 6 + } + }, + "publish": { + "type": "object", + "description": "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.", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented is by default list. To get this list, you need to make a call to the endpoint returned in the url attribute." + }, + "count": { + "type": "integer", + "description": "Publication events counter." + }, + "entries": { + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "type": "string", + "description": "The endpoint where this list of publications can be accessed using a GET method. /v1/vouchers/{voucher_code}/publications" + } + }, + "required": [ + "object" + ] + }, + "redemption": { + "type": "object", + "description": "Stores a summary of redemptions that have been applied to the voucher.", + "properties": { + "quantity": { + "type": [ + "integer", + "null" + ], + "description": "How many times a voucher can be redeemed. A null value means unlimited." + }, + "redeemed_points": { + "type": "integer", + "description": "Total loyalty points redeemed." + }, + "redeemed_quantity": { + "type": "integer", + "description": "How many times a voucher has already been redeemed." + }, + "redemption_entries": { + "type": "array", + "items": { + "type": "string" + } + }, + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented is by default list. To get this list, you need to make a call to the endpoint returned in the url attribute." + }, + "url": { + "type": "string", + "description": "The endpoint where this list of redemptions can be accessed using a GET method. /v1/vouchers/{voucher_code}/redemptions" + } + }, + "required": [ + "quantity" + ] + }, + "active": { + "type": "string", + "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" + }, + "additional_info": { + "type": [ + "string", + "null" + ], + "description": "An optional field to keep any extra textual information about the code such as a code description and details." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the code. 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." + }, + "assets": { + "type": "object", + "description": "Stores links to images of QR and barcode that correspond to an encrypted voucher code.", + "properties": { + "qr": { + "type": "object", + "description": "Stores Quick Response (QR) representation of encrypted code.", + "properties": { + "id": { + "type": "string", + "example": "U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK+t4pp7U7oFzjGJzj9q/bmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg+BaZk5QwXMf8k/OzSlOEVybpwSq+AiqPoNtjeuqtIgkDyvT6Q==", + "description": "Encrypted voucher code ID." + }, + "url": { + "type": "string", + "example": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19ucFhvVmBVpVYG5KoswTsjSIaqoKg5L9ie4BK%2Bt4pp7U7oFzjGJzj9q%2FbmuMOj9mEFiVKDMIkSaruKedMvHbKoPX5Sg%2BBaZk5QwXMf8k%2FOzSlOEVybpwSq%2BAiqPoNtjeuqtIgkDyvT6Q%3D%3D", + "description": "URL to QR code \n\n*Optional:* Attach query parameters to base URL to customize the image of the encrypted voucher code. \n\n- `size`: integer value from `1` to `100` \n- `format`: string, either `png` (default) or `svg`" + } + } + }, + "barcode": { + "type": "object", + "description": "Stores barcode representation of encrypted code.", + "properties": { + "id": { + "type": "string", + "example": "U2FsdGVkX19eJhGfWwUrH9+tulBkON+AnMktic+N6CVWzZ9+fHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ+kJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6/pFs61apEn9SJx32ttCF6d3oxKISQQ==", + "description": "Encrypted voucher code ID." + }, + "url": { + "type": "string", + "example": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19eJhGfWwUrH9%2BtulBkON%2BAnMktic%2BN6CVWzZ9%2BfHVxuVx22WakrzxiWXy0skuvvEHSeZIw9HlgyIJ%2BkJ1iPdUKpyENuNYJKzoZlO0mmTf6WQM6%2FpFs61apEn9SJx32ttCF6d3oxKISQQ%3D%3D", + "description": "URL to barcode \n\n*Optional:* Attach query parameters to base URL to customize the image of the encrypted voucher code. \n\n- `size`: integer value from `1` to `100` \n- `format`: string, either `png` (default) or `svg`" + } + } + } + } + }, + "is_referral_code": { + "type": "boolean", + "description": "Flag indicating whether this voucher is a referral code." + }, + "holder_id": { + "type": "string", + "description": "Unique customer ID of voucher owner." + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the voucher was last updated in ISO 8601 format.", + "format": "date-time" + }, + "created_at": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "id", + "code", + "category", + "category_id", + "type", + "loyalty_card", + "start_date", + "expiration_date", + "validity_timeframe", + "validity_day_of_week", + "active", + "additional_info", + "metadata", + "is_referral_code", + "created_at" + ] + }, + "LoyaltiesTransferPoints": { + "title": "Loyalties Transfer Points", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique loyalty card code from which the user wants to transfer loyalty points (source)." + }, + "points": { + "type": "integer", + "description": "The number of loyalty points that the user wants to transfer to another loyalty card. The number of points cannot be higher than the current balance on the loyalty card (source)." + }, + "reason": { + "type": "string", + "description": "Reason for the transfer." + }, + "source_id": { + "type": "string", + "description": "The merchant’s transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service." + } + }, + "required": [ + "code", + "points", + "source_id" + ] + }, + "LoyaltiesTransferPointsRequestBody": { + "title": "Loyalties Transfer Points Request Body", + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltiesTransferPoints" + } + }, + "LoyaltiesAddOrRemoveCardBalanceRequestBody": { + "title": "Loyalties Add Or Remove Card Balance Request Body", + "type": "object", + "properties": { + "points": { + "type": "integer", + "description": "Incremental balance to be added to/subtracted from the loyalty card.\n\n- To add points: 100\n- To subtract points, add a minus: -100" + }, + "expiration_type": { + "$ref": "#/components/schemas/PointsExpirationTypes", + "description": "Set the type of expiration for added points.\n\n`PROGRAM_RULES`: Inherit rules from campaign.\n`NON_EXPIRING`: Points never expire.\n`CUSTOM_DATE`: Points expire on a particular date. Requires expiration_date parameter." + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Set expiration date for added points, i.e. `YYYY-MM-DD`. This parameter is required only when expiration_type is set to `CUSTOM_DATE`." + }, + "reason": { + "type": "string", + "description": "Reason for the transfer." + }, + "source_id": { + "type": "string", + "description": "The merchant’s transaction ID if it is different from the Voucherify transaction ID. It is really useful in case of an integration between multiple systems. It can be a transaction ID from a CRM system, database or 3rd-party service." + } + }, + "required": [ + "points" + ] + }, + "PointsExpirationTypes": { + "title": "Points Expiration Types", + "type": "string", + "enum": [ + "PROGRAM_RULES", + "CUSTOM_DATE", + "NON_EXPIRING" + ] + }, + "Category": { + "title": "Category", + "type": "object", + "description": "This is an object representing a category.", + "properties": { + "id": { + "type": "string", + "description": "Unique category ID assigned by Voucherify." + }, + "name": { + "type": "string", + "description": "Category name." + }, + "hierarchy": { + "type": "integer", + "description": "Category hierarchy." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the category was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the category was updated in ISO 8601 format." + }, + "object": { + "type": "string", + "enum": [ + "category" + ], + "description": "The type of object represented by the JSON. This object stores information about the category." + } + }, + "required": [ + "id", + "name", + "hierarchy", + "created_at", + "object" + ] + }, + "ExportsCreateRequestBody": { + "anyOf": [ + { + "title": "Export Vouchers", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "voucher" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportVoucherOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportVoucherFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportVoucherFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + }, + { + "title": "Export Redemptions", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "redemption" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportRedemptionOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportRedemptionFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportRedemptionFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + }, + { + "title": "Export Customers", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "customer" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportCustomerOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportCustomerFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportCustomerFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + }, + { + "title": "Export Publications", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "publication" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportPublicationOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportPublicationFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportPublicationFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + }, + { + "title": "Export Order", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "order" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportOrderOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportOrderFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportOrderFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + }, + { + "title": "Export Points Expirations", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "points_expiration" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportPointsExpirationOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportPointsExpirationFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportPointsExpirationFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + }, + { + "title": "Export Vouchers Transactions Expiration", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "voucher_transactions" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportVoucherTransactionsOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportVoucherTransactionsFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportVoucherTransactionsFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object" + ] + } + ], + "type": "object" + }, + "ExportBase": { + "title": "Export Base", + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "description": "Unique export ID." + }, + "object": { + "type": "string", + "enum": [ + "export" + ], + "description": "The type of object being represented. This object stores information about the export." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format." + }, + "status": { + "enum": [ + "SCHEDULED", + "IN_PROGRESS", + "DONE", + "ERROR" + ], + "type": "string", + "description": "Status of the export. Informs you whether the export has already been completed, i.e. indicates whether the file containing the exported data has been generated." + }, + "channel": { + "type": "string", + "description": "The channel through which the export was triggered." + }, + "result": { + "type": [ + "object", + "null" + ], + "required": [ + "url" + ], + "description": "Contains the URL of the CSV file.", + "properties": { + "url": { + "type": "string", + "description": "URL of the CSV file location. It contains the token used for authorization in the Download export method." + } + } + }, + "user_id": { + "type": [ + "string", + "null" + ], + "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the channel value is WEBSITE." + } + }, + "required": [ + "id", + "object", + "created_at", + "status", + "result", + "user_id" + ] + }, + "Export": { + "title": "Export", + "allOf": [ + { + "$ref": "#/components/schemas/ExportBase" + }, + { + "anyOf": [ + { + "$ref": "#/components/schemas/ExportVoucher" + }, + { + "$ref": "#/components/schemas/ExportRedemption" + }, + { + "$ref": "#/components/schemas/ExportCustomer" + }, + { + "$ref": "#/components/schemas/ExportPublication" + }, + { + "$ref": "#/components/schemas/ExportOrder" + }, + { + "$ref": "#/components/schemas/ExportPointsExpiration" + }, + { + "$ref": "#/components/schemas/ExportVoucherTransactionsExpiration" + } + ] + } + ] + }, + "ExportsCreateResponseBody": { + "allOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique export ID." + }, + "object": { + "type": "string", + "enum": [ + "export" + ], + "description": "The type of object being represented. This object stores information about the export." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format." + }, + "status": { + "type": "string", + "description": "Status of the export. Informs you whether the export has already been completed, i.e. indicates whether the file containing the exported data has been generated.", + "enum": [ + "SCHEDULED" + ] + }, + "channel": { + "type": "string", + "description": "The channel through which the export was triggered." + }, + "result": { + "type": "null", + "description": "Contains the URL of the CSV file." + }, + "user_id": { + "type": "string", + "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the channel value is WEBSITE." + } + }, + "required": [ + "id", + "object", + "created_at", + "status", + "result", + "user_id" + ] + }, + { + "anyOf": [ + { + "$ref": "#/components/schemas/ExportVoucher" + }, + { + "$ref": "#/components/schemas/ExportRedemption" + }, + { + "$ref": "#/components/schemas/ExportCustomer" + }, + { + "$ref": "#/components/schemas/ExportPublication" + }, + { + "$ref": "#/components/schemas/ExportOrder" + }, + { + "$ref": "#/components/schemas/ExportPointsExpiration" + }, + { + "$ref": "#/components/schemas/ExportVoucherTransactionsExpiration" + } + ] + } + ], + "title": "" + }, + "ExportVoucher": { + "title": "Export Vouchers", + "type": "object", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "voucher" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportVoucherOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportVoucherFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportVoucherFilters", + "description": "Filter conditions." + } + } + } + }, + "required": [ + "exported_object", + "parameters" + ] + }, + "FieldConditions": { + "title": "Field Conditions", + "type": "object", + "properties": { + "conditions": { + "$ref": "#/components/schemas/FiltersCondition", + "description": "Data filters used to narrow the data records to be returned in the result." + } + } + }, + "FiltersCondition": { + "title": "Filters Condition", + "type": "object", + "properties": { + "$in": { + "$ref": "#/components/schemas/Any" + }, + "$not_in": { + "$ref": "#/components/schemas/Any" + }, + "$is": { + "$ref": "#/components/schemas/Any" + }, + "$is_days_ago": { + "$ref": "#/components/schemas/Any" + }, + "$is_days_in_future": { + "$ref": "#/components/schemas/Any" + }, + "$is_not": { + "$ref": "#/components/schemas/Any" + }, + "$has_value": { + "$ref": "#/components/schemas/Any" + }, + "$is_unknown": { + "$ref": "#/components/schemas/Any" + }, + "$contains": { + "$ref": "#/components/schemas/Any" + }, + "$not_contain": { + "$ref": "#/components/schemas/Any" + }, + "$starts_with": { + "$ref": "#/components/schemas/Any" + }, + "$ends_with": { + "$ref": "#/components/schemas/Any" + }, + "$more_than": { + "$ref": "#/components/schemas/Any" + }, + "$less_than": { + "$ref": "#/components/schemas/Any" + }, + "$more_than_ago": { + "$ref": "#/components/schemas/Any" + }, + "$less_than_ago": { + "$ref": "#/components/schemas/Any" + }, + "$more_than_future": { + "$ref": "#/components/schemas/Any" + }, + "$less_than_future": { + "$ref": "#/components/schemas/Any" + }, + "$more_than_equal": { + "$ref": "#/components/schemas/Any" + }, + "$less_than_equal": { + "$ref": "#/components/schemas/Any" + }, + "$after": { + "$ref": "#/components/schemas/Any" + }, + "$before": { + "$ref": "#/components/schemas/Any" + }, + "$count": { + "$ref": "#/components/schemas/Any" + }, + "$count_less": { + "$ref": "#/components/schemas/Any" + }, + "$count_more": { + "$ref": "#/components/schemas/Any" + } + } + }, + "ExportVoucherFilters": { + "title": "Export Voucher Filters", + "type": "object", + "properties": { + "junction": { + "$ref": "#/components/schemas/Junction", + "description": "Filter by conditions set on the junction parameter indicating how the conditions should be accounted for in the query. An AND is an all-inclusive logical operator, meaning the AND operator displays a record if ALL the conditions separated by AND are TRUE, while an OR operator displays a record if ANY of the conditions separated by OR is TRUE." + }, + "code": { + "$ref": "#/components/schemas/FieldConditions" + }, + "voucher_type": { + "$ref": "#/components/schemas/FieldConditions" + }, + "value": { + "$ref": "#/components/schemas/FieldConditions" + }, + "discount_type": { + "$ref": "#/components/schemas/FieldConditions" + }, + "campaign": { + "$ref": "#/components/schemas/FieldConditions" + }, + "category": { + "$ref": "#/components/schemas/FieldConditions" + }, + "start_date": { + "$ref": "#/components/schemas/FieldConditions" + }, + "expiration_date": { + "$ref": "#/components/schemas/FieldConditions" + }, + "gift_balance": { + "$ref": "#/components/schemas/FieldConditions" + }, + "loyalty_balance": { + "$ref": "#/components/schemas/FieldConditions" + }, + "redemption_quantity": { + "$ref": "#/components/schemas/FieldConditions" + }, + "redemption_count": { + "$ref": "#/components/schemas/FieldConditions" + }, + "active": { + "$ref": "#/components/schemas/FieldConditions" + }, + "qr_code": { + "$ref": "#/components/schemas/FieldConditions" + }, + "bar_code": { + "$ref": "#/components/schemas/FieldConditions" + }, + "metadata": { + "$ref": "#/components/schemas/FieldConditions" + }, + "id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "is_referral_code": { + "$ref": "#/components/schemas/FieldConditions" + }, + "created_at": { + "$ref": "#/components/schemas/FieldConditions" + }, + "updated_at": { + "$ref": "#/components/schemas/FieldConditions" + }, + "validity_timeframe_interval": { + "$ref": "#/components/schemas/FieldConditions" + }, + "validity_timeframe_duration": { + "$ref": "#/components/schemas/FieldConditions" + }, + "validity_day_of_week": { + "$ref": "#/components/schemas/FieldConditions" + }, + "discount_amount_limit": { + "$ref": "#/components/schemas/FieldConditions" + }, + "campaign_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "additional_info": { + "$ref": "#/components/schemas/FieldConditions" + }, + "customer_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "discount_unit_type": { + "$ref": "#/components/schemas/FieldConditions" + }, + "discount_unit_effect": { + "$ref": "#/components/schemas/FieldConditions" + }, + "customer_source_id": { + "$ref": "#/components/schemas/FieldConditions" + } + } + }, + "Junction": { + "title": "Junction", + "enum": [ + "and", + "AND", + "or", + "OR" + ], + "type": "string" + }, + "ExportRedemption": { + "title": "Export Redemptions", + "type": "object", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "redemption" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportRedemptionOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportRedemptionFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportRedemptionFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object", + "parameters" + ] + }, + "ExportRedemptionFilters": { + "title": "Export Redemption Filters", + "type": "object", + "additionalProperties": false, + "properties": { + "junction": { + "$ref": "#/components/schemas/Junction" + }, + "id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "object": { + "$ref": "#/components/schemas/FieldConditions" + }, + "date": { + "$ref": "#/components/schemas/FieldConditions" + }, + "voucher_code": { + "$ref": "#/components/schemas/FieldConditions" + }, + "campaign": { + "$ref": "#/components/schemas/FieldConditions" + }, + "promotion_tier_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "customer_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "customer_source_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "customer_name": { + "$ref": "#/components/schemas/FieldConditions" + }, + "tracking_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "order_amount": { + "$ref": "#/components/schemas/FieldConditions" + }, + "gift_amount": { + "$ref": "#/components/schemas/FieldConditions" + }, + "loyalty_points": { + "$ref": "#/components/schemas/FieldConditions" + }, + "result": { + "$ref": "#/components/schemas/FieldConditions" + }, + "failure_code": { + "$ref": "#/components/schemas/FieldConditions" + }, + "failure_message": { + "$ref": "#/components/schemas/FieldConditions" + }, + "metadata": { + "$ref": "#/components/schemas/FieldConditions" + } + } + }, + "ExportCustomer": { + "title": "Export Customers", + "type": "object", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "customer" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportCustomerOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportCustomerFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportCustomerFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object", + "parameters" + ] + }, + "ExportCustomerFilters": { + "title": "Export Customer Filters", + "type": "object", + "properties": { + "junction": { + "$ref": "#/components/schemas/Junction" + }, + "name": { + "$ref": "#/components/schemas/FieldConditions" + }, + "id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "description": { + "$ref": "#/components/schemas/FieldConditions" + }, + "email": { + "$ref": "#/components/schemas/FieldConditions" + }, + "source_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "created_at": { + "$ref": "#/components/schemas/FieldConditions" + }, + "address_city": { + "$ref": "#/components/schemas/FieldConditions" + }, + "address_state": { + "$ref": "#/components/schemas/FieldConditions" + }, + "address_line_1": { + "$ref": "#/components/schemas/FieldConditions" + }, + "address_line_2": { + "$ref": "#/components/schemas/FieldConditions" + }, + "address_country": { + "$ref": "#/components/schemas/FieldConditions" + }, + "address_postal_code": { + "$ref": "#/components/schemas/FieldConditions" + }, + "redemptions_total_redeemed": { + "$ref": "#/components/schemas/FieldConditions" + }, + "redemptions_total_failed": { + "$ref": "#/components/schemas/FieldConditions" + }, + "redemptions_total_succeeded": { + "$ref": "#/components/schemas/FieldConditions" + }, + "redemptions_total_rolled_back": { + "$ref": "#/components/schemas/FieldConditions" + }, + "redemptions_total_rollback_failed": { + "$ref": "#/components/schemas/FieldConditions" + }, + "redemptions_total_rollback_succeeded": { + "$ref": "#/components/schemas/FieldConditions" + }, + "orders_total_amount": { + "$ref": "#/components/schemas/FieldConditions" + }, + "orders_total_count": { + "$ref": "#/components/schemas/FieldConditions" + }, + "orders_average_amount": { + "$ref": "#/components/schemas/FieldConditions" + }, + "orders_last_order_amount": { + "$ref": "#/components/schemas/FieldConditions" + }, + "orders_last_order_date": { + "$ref": "#/components/schemas/FieldConditions" + }, + "loyalty_points": { + "$ref": "#/components/schemas/FieldConditions" + }, + "loyalty_referred_customers": { + "$ref": "#/components/schemas/FieldConditions" + }, + "updated_at": { + "$ref": "#/components/schemas/FieldConditions" + }, + "phone": { + "$ref": "#/components/schemas/FieldConditions" + }, + "birthday": { + "$ref": "#/components/schemas/FieldConditions" + }, + "metadata": { + "$ref": "#/components/schemas/FieldConditions" + }, + "birthdate": { + "$ref": "#/components/schemas/FieldConditions" + } + } + }, + "ExportPublication": { + "title": "Export Publications", + "type": "object", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "publication" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportPublicationOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportPublicationFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportPublicationFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object", + "parameters" + ] + }, + "ExportPublicationFilters": { + "title": "Export Publication Filters", + "type": "object", + "properties": { + "junction": { + "$ref": "#/components/schemas/Junction" + }, + "voucher_code": { + "$ref": "#/components/schemas/FieldConditions" + }, + "customer_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "customer_source_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "date": { + "$ref": "#/components/schemas/FieldConditions" + }, + "channel": { + "$ref": "#/components/schemas/FieldConditions" + }, + "campaign": { + "$ref": "#/components/schemas/FieldConditions" + }, + "is_winner": { + "$ref": "#/components/schemas/FieldConditions" + }, + "metadata": { + "$ref": "#/components/schemas/FieldConditions" + } + } + }, + "ExportOrder": { + "title": "Export Orders", + "type": "object", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "order" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportOrderOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportOrderFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportOrderFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object", + "parameters" + ] + }, + "ExportOrderFilters": { + "title": "Export Order Filters", + "type": "object", + "additionalProperties": false, + "properties": { + "junction": { + "$ref": "#/components/schemas/Junction" + }, + "id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "source_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "created_at": { + "$ref": "#/components/schemas/FieldConditions" + }, + "updated_at": { + "$ref": "#/components/schemas/FieldConditions" + }, + "status": { + "$ref": "#/components/schemas/FieldConditions" + }, + "amount": { + "$ref": "#/components/schemas/FieldConditions" + }, + "discount_amount": { + "$ref": "#/components/schemas/FieldConditions" + }, + "items_discount_amount": { + "$ref": "#/components/schemas/FieldConditions" + }, + "total_discount_amount": { + "$ref": "#/components/schemas/FieldConditions" + }, + "total_amount": { + "$ref": "#/components/schemas/FieldConditions" + }, + "customer_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "referrer_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "metadata": { + "$ref": "#/components/schemas/FieldConditions" + } + } + }, + "ExportPointsExpiration": { + "title": "Export Points Expirations", + "type": "object", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "points_expiration" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportPointsExpirationOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportPointsExpirationFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportPointsExpirationFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object", + "parameters" + ] + }, + "ExportPointsExpirationFilters": { + "title": "Export Points Expiration Filters", + "type": "object", + "properties": { + "junction": { + "$ref": "#/components/schemas/Junction" + }, + "id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "campaign_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "voucher_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "points": { + "$ref": "#/components/schemas/FieldConditions" + }, + "status": { + "$ref": "#/components/schemas/FieldConditions" + }, + "expires_at": { + "$ref": "#/components/schemas/FieldConditions" + } + } + }, + "ExportVoucherTransactionsExpiration": { + "title": "Export Vouchers Transactions Expiration", + "type": "object", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "voucher_transactions" + ], + "description": "The type of object to be exported." + }, + "parameters": { + "type": "object", + "properties": { + "order": { + "$ref": "#/components/schemas/ExportVoucherTransactionsOrder", + "description": "How the export is filtered, where the dash - preceding a sorting option means sorting in a descending order." + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file.", + "items": { + "$ref": "#/components/schemas/ExportVoucherTransactionsFields" + } + }, + "filters": { + "$ref": "#/components/schemas/ExportVoucherTransactionsFilters", + "description": "Filter conditions." + } + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + } + }, + "required": [ + "exported_object", + "parameters" + ] + }, + "ExportVoucherTransactionsFilters": { + "title": "Export Voucher Transactions Filters", + "type": "object", + "properties": { + "junction": { + "$ref": "#/components/schemas/Junction" + }, + "id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "campaign_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "voucher_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "type": { + "$ref": "#/components/schemas/FieldConditions" + }, + "source_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "reason": { + "$ref": "#/components/schemas/FieldConditions" + }, + "source": { + "$ref": "#/components/schemas/FieldConditions" + }, + "balance": { + "$ref": "#/components/schemas/FieldConditions" + }, + "amount": { + "$ref": "#/components/schemas/FieldConditions" + }, + "related_transaction_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "created_at": { + "$ref": "#/components/schemas/FieldConditions" + }, + "details": { + "$ref": "#/components/schemas/FieldConditions" + } + } + }, + "ExportsGetResponseBody": { + "$ref": "#/components/schemas/Export", + "title": "" + }, + "ExportsListResponseBody": { + "title": "Exports List Response Body", + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about exports." + }, + "data_ref": { + "type": "string", + "enum": [ + "exports" + ], + "description": "Identifies the name of the attribute that contains the array of exports." + }, + "exports": { + "type": "array", + "description": "An array of export objects.", + "items": { + "$ref": "#/components/schemas/Export" + } + }, + "total": { + "type": "integer", + "description": "Total number of exports." + } + }, + "required": [ + "object", + "data_ref", + "exports", + "total" + ] + }, + "ExportCustomerFields": { + "type": "string", + "enum": [ + "name", + "id", + "description", + "email", + "source_id", + "created_at", + "address_city", + "address_state", + "address_line_1", + "address_line_2", + "address_country", + "address_postal_code", + "redemptions_total_redeemed", + "redemptions_total_failed", + "redemptions_total_succeeded", + "redemptions_total_rolled_back", + "redemptions_total_rollback_failed", + "redemptions_total_rollback_succeeded", + "orders_total_amount", + "orders_total_count", + "orders_average_amount", + "orders_last_order_amount", + "orders_last_order_date", + "loyalty_points", + "loyalty_referred_customers", + "updated_at", + "phone", + "birthday", + "metadata", + "birthdate" + ], + "title": "Export Customer Fields" + }, + "ExportCustomerOrder": { + "title": "Export Customer Order", + "type": "string", + "enum": [ + "name", + "-name", + "id", + "-id", + "description", + "-description", + "email", + "-email", + "source_id", + "-source_id", + "created_at", + "-created_at", + "address_city", + "-address_city", + "address_state", + "-address_state", + "address_line_1", + "-address_line_1", + "address_line_2", + "-address_line_2", + "address_country", + "-address_country", + "address_postal_code", + "-address_postal_code", + "redemptions_total_redeemed", + "-redemptions_total_redeemed", + "redemptions_total_failed", + "-redemptions_total_failed", + "redemptions_total_succeeded", + "-redemptions_total_succeeded", + "redemptions_total_rolled_back", + "-redemptions_total_rolled_back", + "redemptions_total_rollback_failed", + "-redemptions_total_rollback_failed", + "redemptions_total_rollback_succeeded", + "-redemptions_total_rollback_succeeded", + "orders_total_amount", + "-orders_total_amount", + "orders_total_count", + "-orders_total_count", + "orders_average_amount", + "-orders_average_amount", + "orders_last_order_amount", + "-orders_last_order_amount", + "orders_last_order_date", + "-orders_last_order_date", + "loyalty_points", + "-loyalty_points", + "loyalty_referred_customers", + "-loyalty_referred_customers", + "updated_at", + "-updated_at", + "phone", + "-phone", + "birthday", + "-birthday", + "metadata", + "-metadata", + "birthdate", + "-birthdate" + ] + }, + "ExportPublicationFields": { + "title": "Export Publication Fields", + "type": "string", + "enum": [ + "voucher_code", + "customer_id", + "customer_source_id", + "date", + "channel", + "campaign", + "is_winner", + "metadata" + ] + }, + "ExportPublicationOrder": { + "title": "Export Publication Order", + "type": "string", + "enum": [ + "voucher_code", + "-voucher_code", + "customer_id", + "-customer_id", + "customer_source_id", + "-customer_source_id", + "date", + "-date", + "channel", + "-channel", + "campaign", + "-campaign", + "is_winner", + "-is_winner", + "metadata", + "-metadata" + ] + }, + "ExportRedemptionFields": { + "title": "Export Redemption Fields", + "type": "string", + "enum": [ + "id", + "object", + "date", + "voucher_code", + "campaign", + "promotion_tier_id", + "customer_id", + "customer_source_id", + "customer_name", + "tracking_id", + "order_amount", + "gift_amount", + "loyalty_points", + "result", + "failure_code", + "failure_message", + "metadata" + ] + }, + "ExportRedemptionOrder": { + "title": "Export Redemption Order", + "type": "string", + "enum": [ + "id", + "-id", + "object", + "-object", + "date", + "-date", + "voucher_code", + "-voucher_code", + "campaign", + "-campaign", + "promotion_tier_id", + "-promotion_tier_id", + "customer_id", + "-customer_id", + "customer_source_id", + "-customer_source_id", + "customer_name", + "-customer_name", + "tracking_id", + "-tracking_id", + "order_amount", + "-order_amount", + "gift_amount", + "-gift_amount", + "loyalty_points", + "-loyalty_points", + "result", + "-result", + "failure_code", + "-failure_code", + "failure_message", + "-failure_message", + "metadata", + "-metadata" + ] + }, + "ExportVoucherFields": { + "title": "Export Voucher Fields", + "type": "string", + "enum": [ + "code", + "voucher_type", + "value", + "discount_type", + "campaign", + "category", + "start_date", + "expiration_date", + "gift_balance", + "loyalty_balance", + "redemption_quantity", + "redemption_count", + "active", + "qr_code", + "bar_code", + "metadata", + "id", + "is_referral_code", + "created_at", + "updated_at", + "validity_timeframe_interval", + "validity_timeframe_duration", + "validity_day_of_week", + "discount_amount_limit", + "campaign_id", + "additional_info", + "customer_id", + "discount_unit_type", + "discount_unit_effect", + "customer_source_id" + ] + }, + "ExportVoucherOrder": { + "title": "Export Voucher Order", + "type": "string", + "enum": [ + "code", + "-code", + "voucher_type", + "-voucher_type", + "value", + "-value", + "discount_type", + "-discount_type", + "campaign", + "-campaign", + "category", + "-category", + "start_date", + "-start_date", + "expiration_date", + "-expiration_date", + "gift_balance", + "-gift_balance", + "loyalty_balance", + "-loyalty_balance", + "redemption_quantity", + "-redemption_quantity", + "redemption_count", + "-redemption_count", + "active", + "-active", + "qr_code", + "-qr_code", + "bar_code", + "-bar_code", + "metadata", + "-metadata", + "id", + "-id", + "is_referral_code", + "-is_referral_code", + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "validity_timeframe_interval", + "-validity_timeframe_interval", + "validity_timeframe_duration", + "-validity_timeframe_duration", + "validity_day_of_week", + "-validity_day_of_week", + "discount_amount_limit", + "-discount_amount_limit", + "campaign_id", + "-campaign_id", + "additional_info", + "-additional_info", + "customer_id", + "-customer_id", + "discount_unit_type", + "-discount_unit_type", + "discount_unit_effect", + "-discount_unit_effect", + "customer_source_id", + "-customer_source_id" + ] + }, + "ExportOrderFields": { + "title": "Export Order Fields", + "type": "string", + "enum": [ + "id", + "source_id", + "created_at", + "updated_at", + "status", + "amount", + "discount_amount", + "items_discount_amount", + "total_discount_amount", + "total_amount", + "customer_id", + "referrer_id", + "metadata" + ] + }, + "ExportOrderOrder": { + "title": "Export Order Order", + "type": "string", + "enum": [ + "id", + "-id", + "source_id", + "-source_id", + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "status", + "-status", + "amount", + "-amount", + "discount_amount", + "-discount_amount", + "items_discount_amount", + "-items_discount_amount", + "total_discount_amount", + "-total_discount_amount", + "total_amount", + "-total_amount", + "customer_id", + "-customer_id", + "referrer_id", + "-referrer_id", + "metadata", + "-metadata" + ] + }, + "ExportPointsExpirationFields": { + "title": "Export Points Expiration Fields", + "type": "string", + "enum": [ + "id", + "campaign_id", + "voucher_id", + "points", + "status", + "expires_at" + ] + }, + "ExportPointsExpirationOrder": { + "title": "Export Points Expiration Order", + "type": "string", + "enum": [ + "id", + "-id", + "campaign_id", + "-campaign_id", + "voucher_id", + "-voucher_id", + "points", + "-points", + "status", + "-status", + "expires_at", + "-expires_at" + ] + }, + "ExportVoucherTransactionsFields": { + "title": "Export Voucher Transactions Fields", + "type": "string", + "enum": [ + "id", + "campaign_id", + "voucher_id", + "type", + "source_id", + "reason", + "source", + "balance", + "amount", + "related_transaction_id", + "created_at", + "details" + ] + }, + "ExportVoucherTransactionsOrder": { + "title": "Export Voucher Transactions Order", + "type": "string", + "enum": [ + "id", + "-id", + "campaign_id", + "-campaign_id", + "voucher_id", + "-voucher_id", + "type", + "-type", + "source_id", + "-source_id", + "reason", + "-reason", + "source", + "-source", + "balance", + "-balance", + "amount", + "-amount", + "related_transaction_id", + "-related_transaction_id", + "created_at", + "-created_at", + "details", + "-details" + ] + }, + "Any": { + "anyOf": [ + { + "title": "array", + "type": "array", + "items": { + "anyOf": [ + { + "title": "string", + "type": "string" + }, + { + "title": "number", + "type": "number" + }, + { + "title": "object", + "type": "object" + } + ] + } + }, + { + "title": "string", + "type": "string" + }, + { + "title": "number", + "type": "number" + }, + { + "title": "object", + "type": "object" + } + ], + "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" ] }, - "loyalties_reward_assignment_item": { - "title": "Reward Assignment Object", + "LoyaltiesListMemberLoyaltyTiersResponseBody": { + "title": "Loyalties List Member Loyalty Tiers Response Body", + "x-stoplight": { + "id": "s3zpgud510xl6" + }, "type": "object", - "description": "This is an object representing a reward assignment.", - "x-tags": [ - "REWARDS API" - ], "properties": { - "id": { + "object": { "type": "string", - "example": "rewa_PbIRoMXpwe5QhobW4JKu0VjH", - "description": "Unique reward assignment ID, assigned by Voucherify." + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." }, - "reward_id": { + "data_ref": { "type": "string", - "description": "Associated reward ID.", - "example": "rew_C7wS9eHFDN4CIbXI5PpLSkGY" + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." }, - "related_object_id": { - "type": "string", - "description": "Related object ID to which the reward was assigned.", - "example": "camp_wciTvaOfYmAa3EmIIW3QpXXZ" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyTier" + } }, - "related_object_type": { - "type": "string", - "description": "Related object type to which the reward was assigned.", - "example": "campaign" + "total": { + "type": "integer", + "description": "Total number of loyalty tier objects." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "EarningRule": { + "allOf": [ + { + "$ref": "#/components/schemas/EarningRuleBase" }, - "parameters": { - "description": "Defines the cost of the reward.", + { "type": "object", - "required": [ - "loyalty" - ], "properties": { - "loyalty": { - "type": "object", - "description": "Defines the equivalent points value of the reward.", - "required": [ - "points" + "validation_rule_id": { + "type": [ + "string", + "null" ], - "properties": { - "points": { - "type": "integer", - "description": "The number of points required to redeem the reward." - } - } + "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" } - } - }, - "created_at": { + }, + "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", - "description": "Timestamp representing the date and time when the reward assignment was created in ISO 8601 format.", - "example": "2022-08-11T14:49:22.586Z", - "format": "date-time" - }, - "updated_at": { - "type": [ - "string", - "null" + "enum": [ + "list" ], - "description": "Timestamp representing the date and time when the reward assignment was updated in ISO 8601 format.", - "example": "2022-08-11T16:01:34.885Z", - "format": "date-time" + "description": "The type of object represented by JSON. This object stores information about earning rules in a dictionary." }, - "object": { + "data_ref": { "type": "string", - "default": "reward_assignment", - "description": "The type of object represented by the JSON. This object stores information about the reward assignment." + "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": [ - "id", - "reward_id", - "related_object_id", - "related_object_type", - "parameters", - "created_at", - "updated_at", - "object" + "object", + "data_ref", + "data", + "total" ] }, - "loyalties_reward_item_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" - } - ] - } - } - }, - "loyalties_reward_item_parameters_coin": { - "title": "Pay with Points", + "LoyaltyTierBase": { + "title": "Loyalty Tier Base", + "x-stoplight": { + "id": "3af9422223696" + }, "type": "object", - "description": "These are parameters representing a Pay with Points (COIN) reward. ", "properties": { - "coin": { + "name": { + "type": "string", + "description": "Loyalty Tier name." + }, + "earning_rules": { "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" - ], + "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": { - "exchange_ratio": { + "from": { "type": "integer", - "description": "The cash equivalent of the points defined in the `points_ratio` property." + "description": "Bottom points threshold value." }, - "points_ratio": { + "to": { "type": "integer", - "description": "The number of loyalty points that will map to the predefined cash amount defined by the `exchange_ratio` property." + "description": "Top points threshold value." } } } }, "required": [ - "coin" + "name", + "points" ] }, - "loyalties_reward_item_parameters_material": { - "title": "Material", - "type": "object", - "description": "These are parameters representing products as a (MATERIAL) reward.", - "properties": { - "product": { + "LoyaltyTier": { + "allOf": [ + { + "$ref": "#/components/schemas/LoyaltyTierBase" + }, + { "type": "object", - "description": "Contains information about the product given as a reward.", "properties": { "id": { "type": "string", - "example": "prod_0b7d7dfb05cbe5c616", - "description": "Unique product ID, assigned by Voucherify. " + "description": "Unique loyalty tier ID." }, - "sku_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" ], - "description": "Unique SKU ID, assigned by Voucherify, of the SKU given as a reward.", - "example": "sku_0b7d7dfb090be5c619" + "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", @@ -40638,7 +44146,7 @@ "e_400_resource_in_use": { "title": "Resource in use", "type": "object", - "description": "Error: Bad Request → Resource in use", + "description": "Error: Bad Request - Resource in use", "properties": { "code": { "type": "integer", @@ -41154,6 +44662,190 @@ "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." } } + }, + "product_collections_get_response_body": { + "$ref": "#/components/schemas/product_collections_collection_item", + "description": "\"Response body schema for **GET** `/product-collections/{collectionId}`.\",", + "title": "Get Product Collection Response Body" + }, + "product_collections_collection_item": { + "title": "Product Collection Object", + "description": "This is an object representing a product collection. \n\nThe products can be grouped into collections by the creation of a products collection object. You can retrieve a product collection and a list of products in the collection. Product collections are identified by a unique ID.", + "x-tags": [ + "PRODUCT COLLECTIONS API" + ], + "allOf": [ + { + "$ref": "#/components/schemas/product_collections_collection_item_base" + }, + { + "anyOf": [ + { + "$ref": "#/components/schemas/product_collections_static_collection" + }, + { + "$ref": "#/components/schemas/product_collections_dynamic_collection" + } + ] + } + ] + }, + "product_collections_collection_item_base": { + "title": "Product Collection Base", + "description": "This is an object representing a product collection base. ", + "x-tags": [ + "PRODUCT COLLECTIONS API" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Product collection ID." + }, + "name": { + "type": "string", + "example": "All Products", + "description": "Unique user-defined product collection name." + }, + "created_at": { + "type": "string", + "example": "2021-12-09T12:51:29.898Z", + "description": "Timestamp representing the date and time when the product collection was created in ISO 8601 format.", + "format": "date-time" + }, + "object": { + "description": "The type of object represented by JSON. This object stores information about the static product collection.", + "enum": [ + "products_collection" + ] + } + }, + "required": [ + "id", + "name", + "created_at", + "object" + ] + }, + "product_collections_create_request_body": { + "title": "product_collections_create_request_body", + "anyOf": [ + { + "$ref": "#/components/schemas/product_collections_create_static_request_body" + }, + { + "$ref": "#/components/schemas/product_collections_create_dynamic_request_body" + } + ] + }, + "product_collections_create_static_request_body": { + "title": "Create Product Collection - Static", + "type": "object", + "properties": { + "type": { + "enum": [ + "STATIC" + ] + }, + "name": { + "type": "string" + }, + "products": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "product_id": { + "type": "string" + }, + "object": { + "enum": [ + "sku", + "product" + ] + } + }, + "required": [ + "id", + "object" + ] + } + } + }, + "required": [ + "type", + "name" + ] + }, + "product_collections_create_dynamic_request_body": { + "title": "Create Product Collection - Auto Update", + "type": "object", + "properties": { + "type": { + "enum": [ + "AUTO_UPDATE" + ] + }, + "name": { + "type": "string" + }, + "filter": { + "type": "object", + "additionalProperties": false, + "required": [ + "junction" + ], + "properties": { + "junction": { + "$ref": "#/components/schemas/Junction" + }, + "id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "product_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "source_id": { + "$ref": "#/components/schemas/FieldConditions" + }, + "name": { + "$ref": "#/components/schemas/FieldConditions" + }, + "price": { + "$ref": "#/components/schemas/FieldConditions" + }, + "object": { + "$ref": "#/components/schemas/FieldConditions" + }, + "attributes": { + "$ref": "#/components/schemas/FieldConditions" + }, + "metadata": { + "$ref": "#/components/schemas/FieldConditions" + }, + "image_url": { + "$ref": "#/components/schemas/FieldConditions" + }, + "skus": { + "$ref": "#/components/schemas/FieldConditions" + }, + "created_at": { + "$ref": "#/components/schemas/FieldConditions" + }, + "updated_at": { + "$ref": "#/components/schemas/FieldConditions" + } + } + } + }, + "required": [ + "type", + "name", + "filter" + ] } }, "examples": { @@ -65456,7 +69148,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_get_points_expiration" + "$ref": "#/components/schemas/LoyaltiesGetPointsExpirationResponseBody" }, "examples": { "Example": { @@ -68429,7 +72121,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/4_obj_reward_object" + "$ref": "#/components/schemas/LoyaltiesGetRewardDetailsResponseBody" }, "examples": { "Material": { @@ -68962,7 +72654,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + "$ref": "#/components/schemas/LoyaltiesGetRewardAssignmentResponseBody" }, "examples": { "Example": { @@ -71046,7 +74738,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_list_loyalty_tiers" + "$ref": "#/components/schemas/LoyaltiesListTiersResponseBody" }, "examples": { "Example": { @@ -71169,6 +74861,43 @@ } } } + }, + "post": { + "operationId": "create-loyalty-tiers", + "tags": [ + "LOYALTIES API" + ], + "summary": "Create loyalty tiers", + "description": "Creates loyalty tiers for desired campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns created loyalty tiers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesCreateTiersResponseBody" + } + } + } + } + }, + "requestBody": { + "description": "Provide tier definitions you want to add to existing loyalty campaign.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesCreateTiersRequestBody" + } + } + } + } } }, "/v1/loyalties/{campaignId}/tiers/{tierId}": { @@ -71214,7 +74943,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_object" + "$ref": "#/components/schemas/LoyaltyTier" }, "examples": { "Example": { @@ -71304,7 +75033,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_get_member_loyalty_tier" + "$ref": "#/components/schemas/LoyaltiesListMemberLoyaltyTiersResponseBody" }, "examples": { "Example": { @@ -71427,7 +75156,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_list_loyalty_tier_earning_rules" + "$ref": "#/components/schemas/LoyaltiesListLoyaltyTierEarningRulesResponseBody" }, "examples": { "example-1": { @@ -72034,7 +75763,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/loyalties_list_loyalty_tier_rewards_request_body" + "$ref": "#/components/schemas/8_res_list_loyalty_tier_rewards" }, "examples": { "Example": { @@ -76606,7 +80335,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/12_obj_product_collection_object" + "$ref": "#/components/schemas/product_collections_collection_item" } } } @@ -76634,9 +80363,7 @@ "type": "string", "enum": [ "created_at", - "-created_at", - "updated_at", - "-updated_at" + "-created_at" ] }, "in": "query", @@ -76656,7 +80383,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/12_res_product-collections" + "$ref": "#/components/schemas/product_collections_list_response_body" }, "examples": { "Example": { @@ -76826,6 +80553,42 @@ } } } + }, + "post": { + "operationId": "create-product-collection", + "tags": [ + "PRODUCT COLLECTIONS API" + ], + "summary": "Create Product Collection", + "description": "This method creates a new product collection.", + "responses": { + "200": { + "description": "Returns information about the newly created collection, as well as an array containing the products.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/product_collections_collection_item" + } + } + } + } + }, + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/product_collections_create_request_body" + } + } + } + } } }, "/v1/product-collections/{productCollectionId}": { @@ -76861,7 +80624,8 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/12_obj_product_collection_object" + "$ref": "#/components/schemas/product_collections_get_response_body", + "description": "Returns a products collection object if a valid identifier was provided in the path." }, "examples": { "Dynamic": { @@ -77039,7 +80803,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/11_res_product-collections_productCollectionID_products" + "$ref": "#/components/schemas/product_collections_list_products_response_body" }, "examples": { "Example": { From 1817839f46984ae367c767a32d6a686dee1a222e Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 13 Oct 2023 15:25:24 +0200 Subject: [PATCH 04/20] add reward and reward_assignment with required fields --- reference/OpenAPI.json | 493 ++++++++++++++++++++++++++++++++++------- 1 file changed, 409 insertions(+), 84 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index dae42e817..492b85091 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -9465,6 +9465,155 @@ } } }, + "reward_base": { + "title": "Reward Base", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "stock": { + "type": [ + "integer", + "null" + ], + "description": "Configurable for **material rewards**. The number of units of the product that you want to share as reward." + }, + "redeemed": { + "type": [ + "integer", + "null" + ], + "description": "Defines the number of already invoked (successful) reward redemptions.\t" + }, + "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." + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format." + } + }, + "required": [ + "name", + "stock", + "redeemed", + "attributes", + "metadata" + ] + }, + "reward_identity": { + "title": "Reward Object Identity", + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "rew_nIy4gHpQHle2c3pNMwuj7G6j", + "description": "Unique reward ID, assigned by Voucherify." + } + }, + "required": [ + "id" + ] + }, + "reward_response_data": { + "title": "Reward Object Response Data", + "type": "object", + "properties": { + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the reward was created in ISO 8601 format.", + "example": "2022-08-11T14:49:22.586Z", + "format": "date-time" + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "description": "Timestamp representing the date and time when the reward was updated in ISO 8601 format.", + "example": "2022-08-11T16:01:34.885Z", + "format": "date-time" + }, + "object": { + "description": "The type of object represented by the JSON. This object stores information about the reward.", + "enum": [ + "reward" + ] + } + }, + "required": [ + "created_at", + "updated_at", + "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 Object", + "type": "object", + "description": "This is an object representing a reward.", + "x-tags": [ + "REWARDS API" + ], + "allOf": [ + { + "$ref": "#/components/schemas/reward_base" + }, + { + "$ref": "#/components/schemas/reward_identity" + }, + { + "$ref": "#/components/schemas/reward_response_data" + }, + { + "$ref": "#/components/schemas/reward_parameters" + } + ] + }, "4_obj_reward_object": { "title": "Reward Object", "type": "object", @@ -9574,6 +9723,30 @@ } } }, + "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", @@ -9589,7 +9762,11 @@ "description": "Campaign type.", "default": "DISCOUNT_COUPONS" } - } + }, + "required": [ + "id", + "type" + ] }, "4_obj_reward_object_parameters_CAMPAIGN_GIFT_VOUCHERS": { "title": "Gift Vouchers", @@ -9610,7 +9787,12 @@ "description": "Campaign type.", "default": "GIFT_VOUCHERS" } - } + }, + "required": [ + "id", + "balance", + "type" + ] }, "4_obj_reward_object_parameters_CAMPAIGN_LOYALTY_PROGRAM": { "title": "Points on loyalty card", @@ -9631,7 +9813,12 @@ "description": "Campaign type.", "default": "LOYALTY_PROGRAM" } - } + }, + "required": [ + "id", + "balance", + "type" + ] }, "4_obj_reward_object_parameters_COIN": { "title": "Pay with Points", @@ -9654,6 +9841,34 @@ } } }, + "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", @@ -9680,6 +9895,39 @@ } } }, + "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`.", @@ -10187,6 +10435,137 @@ } } }, + "reward_assignment_base": { + "title": "Reward Assignment Base", + "type": "object", + "x-tags": [ + "REWARDS API" + ], + "properties": { + "related_object_id": { + "type": "string", + "description": "Related object ID to which the reward was assigned.", + "example": "camp_wciTvaOfYmAa3EmIIW3QpXXZ" + }, + "related_object_type": { + "description": "Related object type to which the reward was assigned.", + "enum": [ + "campaign" + ] + }, + "parameters": { + "description": "Defines the cost of the reward.", + "type": "object", + "properties": { + "loyalty": { + "type": "object", + "description": "Defines the equivalent points value of the reward.", + "required": [ + "points" + ], + "properties": { + "points": { + "type": "integer", + "description": "The number of points required to redeem the reward." + } + } + } + }, + "required": [ + "loyalty" + ] + } + }, + "required": [ + "related_object_id", + "related_object_type" + ] + }, + "reward_assignment_identity": { + "title": "Reward Assignment Identity", + "type": "object", + "x-tags": [ + "REWARDS API" + ], + "properties": { + "id": { + "type": "string", + "example": "rewa_PbIRoMXpwe5QhobW4JKu0VjH", + "description": "Unique reward assignment ID, assigned by Voucherify." + }, + "reward_id": { + "type": "string", + "description": "Associated reward ID.", + "example": "rew_C7wS9eHFDN4CIbXI5PpLSkGY" + } + }, + "required": [ + "id", + "reward_id" + ] + }, + "reward_assignment_response_data": { + "title": "Reward Assignment Response Data", + "type": "object", + "x-tags": [ + "REWARDS API" + ], + "properties": { + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the reward assignment was created in ISO 8601 format.", + "example": "2022-08-11T14:49:22.586Z", + "format": "date-time" + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "description": "Timestamp representing the date and time when the reward assignment was updated in ISO 8601 format.", + "example": "2022-08-11T16:01:34.885Z", + "format": "date-time" + }, + "object": { + "description": "The type of object represented by the JSON. This object stores information about the reward assignment.", + "enum": [ + "reward_assignment" + ] + } + }, + "required": [ + "created_at", + "updated_at", + "object" + ] + }, + "reward_assignment": { + "title": "Reward Assignment Object", + "description": "This is an object representing a reward assignment.", + "x-tags": [ + "REWARDS API" + ], + "allOf": [ + { + "$ref": "#/components/schemas/reward_assignment_base", + "x-stoplight": { + "id": "jh3hi27sz0tb0" + } + }, + { + "$ref": "#/components/schemas/reward_assignment_identity", + "x-stoplight": { + "id": "t6wsmzz6nx39e" + } + }, + { + "$ref": "#/components/schemas/reward_assignment_response_data", + "x-stoplight": { + "id": "oyv1erbi7j8wp" + } + } + ] + }, "4_res_list_reward_assignments": { "type": "object", "description": "Response body schema for **GET** `/rewards/{rewardID}/assignments`.", @@ -22769,7 +23148,7 @@ } } }, - "8_obj_loyalty_tier_reward_object": { + "loyalties_loyalty_tier_reward": { "title": "Loyalty Tier Reward Object", "type": "object", "description": "This is an object representing a loyalty tier reward.", @@ -22778,17 +23157,23 @@ ], "properties": { "reward": { - "$ref": "#/components/schemas/4_obj_reward_object" + "$ref": "#/components/schemas/reward" }, "assignment": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + "$ref": "#/components/schemas/reward_assignment" }, "object": { - "type": "string", - "default": "loyalty_tier_reward", - "description": "The type of object represented by JSON. This object stores information about the loyalty tier reward." + "description": "The type of object represented by JSON. This object stores information about the loyalty tier reward.", + "enum": [ + "loyalty_tier_reward" + ] } - } + }, + "required": [ + "reward", + "assignment", + "object" + ] }, "8_obj_loyalty_card_object_non_expanded_categories": { "title": "Loyalty Card Object", @@ -29488,7 +29873,7 @@ } } }, - "8_res_list_loyalty_tier_rewards": { + "loyalties_list_loyalty_tier_rewards_response_body": { "title": "List Loyalty Tier Rewards", "type": "object", "description": "Response schema for `/loyalties/{campaignId}/tiers/{tierId}/rewards`.", @@ -29507,14 +29892,20 @@ "type": "array", "description": "Contains array of loyalty tier reward objects.", "items": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_reward_object" + "$ref": "#/components/schemas/loyalties_loyalty_tier_reward" } }, "total": { "type": "integer", "description": "Total number of loyalty tier reward objects." } - } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] }, "8_res_list_members": { "title": "List Members", @@ -39540,9 +39931,6 @@ }, "EarningRuleBase": { "title": "EarningRuleBase", - "x-stoplight": { - "id": "w4ci1ljqva0r1" - }, "type": "object", "properties": { "id": { @@ -39680,9 +40068,6 @@ }, "EarningRuleEvent": { "title": "EarningRuleEvent", - "x-stoplight": { - "id": "6vxql7fnzg2zp" - }, "type": "string", "enum": [ "order.paid", @@ -39697,9 +40082,6 @@ }, "EarningRuleFixed": { "title": "Define fixed amount of points", - "x-stoplight": { - "id": "r5o8m0sdli7fq" - }, "type": "object", "properties": { "type": { @@ -39731,9 +40113,6 @@ }, "EarningRuleProportionalOrderAmount": { "title": "Order Amount", - "x-stoplight": { - "id": "1z7lk7z1lp5af" - }, "type": "object", "properties": { "type": { @@ -39785,9 +40164,6 @@ }, "EarningRuleProportionalOrderTotalAmount": { "title": "Order Total Amount", - "x-stoplight": { - "id": "ekudxr430edgk" - }, "type": "object", "properties": { "type": { @@ -39839,9 +40215,6 @@ }, "EarningRuleProportionalOrderMetadata": { "title": "Order Metadata", - "x-stoplight": { - "id": "4ccw4gz8b47u5" - }, "type": "object", "properties": { "type": { @@ -39899,9 +40272,6 @@ }, "EarningRuleProportionalOrderItemsQuantity": { "title": "Order Items Quantity", - "x-stoplight": { - "id": "pqsn9otpzyot9" - }, "type": "object", "properties": { "type": { @@ -39968,9 +40338,6 @@ }, "EarningRuleProportionalOrderItemsAmount": { "title": "Order Items Amount", - "x-stoplight": { - "id": "8pg4o23daepkb" - }, "type": "object", "properties": { "type": { @@ -40037,9 +40404,6 @@ }, "EarningRuleProportionalOrderItemsSubtotalAmount": { "title": "Order Items Subtotal Amount", - "x-stoplight": { - "id": "duxy5qw36h5ph" - }, "type": "object", "properties": { "type": { @@ -43373,9 +43737,6 @@ }, "LoyaltiesCreateTiersRequestBody": { "title": "Loyalties Create Tiers Request Body", - "x-stoplight": { - "id": "i1emmwlaqp7lt" - }, "type": "array", "items": { "allOf": [ @@ -43396,31 +43757,19 @@ }, "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" - } + "$ref": "#/components/schemas/RewardAssignment" }, "LoyaltiesGetRewardDetailsResponseBody": { - "$ref": "#/components/schemas/Reward", - "x-stoplight": { - "id": "44hds9u0hhukf" - } + "$ref": "#/components/schemas/Reward" }, "LoyaltiesListTiersRequestQuery": { "title": "Loyalties List Tiers Request Query", - "x-stoplight": { - "id": "d5sluzqkxu8km" - }, "type": "object", "properties": { "limit": { @@ -43447,9 +43796,6 @@ }, "LoyaltiesListLoyaltyTierEarningRulesRequestQuery": { "title": "LoyaltiesListLoyaltyTierEarningRulesRequestQuery", - "x-stoplight": { - "id": "zs0z1cyyzac9u" - }, "type": "object", "properties": { "limit": { @@ -43465,16 +43811,10 @@ } }, "LoyaltiesGetTierResponseBody": { - "$ref": "#/components/schemas/LoyaltyTier", - "x-stoplight": { - "id": "hzcsijl2b4d5o" - } + "$ref": "#/components/schemas/LoyaltyTier" }, "LoyaltiesListTiersResponseBody": { "title": "Loyalties List Tiers Response Body", - "x-stoplight": { - "id": "kw06g2szvv479" - }, "type": "object", "properties": { "object": { @@ -43512,9 +43852,6 @@ }, "LoyaltiesListMemberLoyaltyTiersResponseBody": { "title": "Loyalties List Member Loyalty Tiers Response Body", - "x-stoplight": { - "id": "s3zpgud510xl6" - }, "type": "object", "properties": { "object": { @@ -43587,9 +43924,6 @@ }, "LoyaltiesListLoyaltyTierEarningRulesResponseBody": { "title": "Loyalties List Loyalty Tier Earning Rules ResponseBody", - "x-stoplight": { - "id": "i180zbh3ffwaa" - }, "type": "object", "properties": { "object": { @@ -43627,9 +43961,6 @@ }, "LoyaltyTierBase": { "title": "Loyalty Tier Base", - "x-stoplight": { - "id": "3af9422223696" - }, "type": "object", "properties": { "name": { @@ -43787,9 +44118,6 @@ }, "MappingMultiply": { "title": "MappingMultiply", - "x-stoplight": { - "id": "7zrwgr2oqh4tj" - }, "type": "object", "properties": { "type": { @@ -43807,9 +44135,6 @@ }, "MappingFixed": { "title": "MappingFixed", - "x-stoplight": { - "id": "86eksegayxcxa" - }, "type": "object", "properties": { "type": { @@ -72723,7 +73048,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + "$ref": "#/components/schemas/reward_assignment" }, "examples": { "Example": { @@ -75763,7 +76088,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_list_loyalty_tier_rewards" + "$ref": "#/components/schemas/loyalties_list_loyalty_tier_rewards_response_body" }, "examples": { "Example": { From 0a7de7d9125007090d0fbd51b30665720350ebc3 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 13 Oct 2023 15:40:14 +0200 Subject: [PATCH 05/20] update all reward assignment methods --- reference/OpenAPI.json | 93 +++++++++++++++++++++--------------------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 492b85091..ad5806f99 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -9466,7 +9466,7 @@ } }, "reward_base": { - "title": "Reward Base", + "title": "Reward Object Base", "type": "object", "properties": { "name": { @@ -10547,26 +10547,17 @@ ], "allOf": [ { - "$ref": "#/components/schemas/reward_assignment_base", - "x-stoplight": { - "id": "jh3hi27sz0tb0" - } + "$ref": "#/components/schemas/reward_assignment_base" }, { - "$ref": "#/components/schemas/reward_assignment_identity", - "x-stoplight": { - "id": "t6wsmzz6nx39e" - } + "$ref": "#/components/schemas/reward_assignment_identity" }, { - "$ref": "#/components/schemas/reward_assignment_response_data", - "x-stoplight": { - "id": "oyv1erbi7j8wp" - } + "$ref": "#/components/schemas/reward_assignment_response_data" } ] }, - "4_res_list_reward_assignments": { + "rewards_list_assignments_response_body": { "type": "object", "description": "Response body schema for **GET** `/rewards/{rewardID}/assignments`.", "title": "List Reward Assignments Response Body", @@ -10584,16 +10575,22 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + "$ref": "#/components/schemas/reward_assignment" } }, "total": { "type": "integer", "description": "Total number of reward assignments." } - } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] }, - "4_req_update_reward_assignment": { + "rewards_update_assignments_request_body": { "type": "object", "description": "Request body schema for **PUT** `/rewards/{rewardID}/assignments/{assignmentID}`.", "title": "Update Reward Assignment Request Body", @@ -10616,39 +10613,43 @@ } } }, - "4_req_create_reward_assignment": { - "type": "object", + "rewards_create_assignment_request_body": { "description": "Request body schema for **POST** `/rewards/{rewardID}/assignments`.", "title": "Create Reward Assignment Request Body", - "properties": { - "campaign": { - "type": "string", - "description": "The campaign ID of the campaign to which the reward is to be assigned." - }, - "parameters": { - "type": "object", - "description": "Defines the cost of the reward.", - "required": [ - "loyalty" - ], + "oneOf": [ + { "properties": { - "loyalty": { + "campaign": { + "type": "string", + "description": "The campaign ID of the campaign to which the reward is to be assigned." + }, + "parameters": { "type": "object", - "description": "Defines the equivalent points value of the reward.", + "description": "Defines the cost of the reward.", + "required": [ + "loyalty" + ], "properties": { - "points": { - "type": "integer", - "description": "Number of points that will be subtracted from the loyalty card points balance if the reward is redeemed." + "loyalty": { + "type": "object", + "description": "Defines the equivalent points value of the reward.", + "properties": { + "points": { + "type": "integer", + "description": "Number of points that will be subtracted from the loyalty card points balance if the reward is redeemed." + } + } } } } - } + }, + "required": [ + "campaign", + "parameters" + ] } - }, - "required": [ - "campaign", - "parameters" - ] + ], + "type": "object" }, "5_obj_publication_object": { "title": "Publication Object", @@ -54376,7 +54377,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/4_res_list_reward_assignments" + "$ref": "#/components/schemas/rewards_list_assignments_response_body" }, "examples": { "Example": { @@ -54464,7 +54465,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/4_req_create_reward_assignment" + "$ref": "#/components/schemas/rewards_create_assignment_request_body" }, "examples": { "Example": { @@ -54487,7 +54488,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + "$ref": "#/components/schemas/reward_assignment" }, "examples": { "Example": { @@ -54655,7 +54656,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + "$ref": "#/components/schemas/reward_assignment" }, "examples": { "Example": { @@ -73145,7 +73146,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_req_update_reward_assignment" + "$ref": "#/components/schemas/rewards_update_assignments_request_body" }, "examples": { "Example": { From b5abd9ed1b1de44c022740ace902de47f6ad38ee Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 13 Oct 2023 16:18:12 +0200 Subject: [PATCH 06/20] Update OpenAPI.json --- reference/OpenAPI.json | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index ad5806f99..1367f7dab 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -10590,7 +10590,7 @@ "total" ] }, - "rewards_update_assignments_request_body": { + "rewards_update_assignment_request_body": { "type": "object", "description": "Request body schema for **PUT** `/rewards/{rewardID}/assignments/{assignmentID}`.", "title": "Update Reward Assignment Request Body", @@ -10647,6 +10647,17 @@ "campaign", "parameters" ] + }, + { + "properties": { + "campaign": { + "type": "string", + "description": "The campaign ID of the campaign to which the reward is to be assigned." + } + }, + "required": [ + "campaign" + ] } ], "type": "object" @@ -54634,7 +54645,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/4_req_update_reward_assignment" + "$ref": "#/components/schemas/rewards_update_assignment_request_body" }, "examples": { "Example": { @@ -73146,7 +73157,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/rewards_update_assignments_request_body" + "$ref": "#/components/schemas/rewards_update_assignment_request_body" }, "examples": { "Example": { From 48c263568dcd7bd85880b5bc25734bb55b715f6d Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Mon, 16 Oct 2023 08:41:07 +0200 Subject: [PATCH 07/20] Update OpenAPI.json --- reference/OpenAPI.json | 71 ++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 40 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 1367f7dab..97ec10505 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -10590,14 +10590,32 @@ "total" ] }, - "rewards_update_assignment_request_body": { - "type": "object", - "description": "Request body schema for **PUT** `/rewards/{rewardID}/assignments/{assignmentID}`.", - "title": "Update Reward Assignment Request Body", + "rewards_create_assignment_request_body": { + "description": "Request body schema for **POST** `/rewards/{rewardID}/assignments`.", + "title": "Create Reward Assignment Request Body", + "oneOf": [ + { + "$ref": "#/components/schemas/rewards_create_assignment_main_reward_request_body" + }, + { + "$ref": "#/components/schemas/rewards_create_assignment_coin_reward_request_body" + } + ] + }, + "rewards_create_assignment_main_reward_request_body": { + "description": "Request body schema for **POST** `/rewards/{rewardID}/assignments`.", + "title": "Main Reward", "properties": { + "campaign": { + "type": "string", + "description": "The campaign ID of the campaign to which the reward is to be assigned." + }, "parameters": { "type": "object", "description": "Defines the cost of the reward.", + "required": [ + "loyalty" + ], "properties": { "loyalty": { "type": "object", @@ -10611,43 +10629,16 @@ } } } - } + }, + "required": [ + "campaign", + "parameters" + ] }, - "rewards_create_assignment_request_body": { + "rewards_create_assignment_coin_reward_request_body": { "description": "Request body schema for **POST** `/rewards/{rewardID}/assignments`.", - "title": "Create Reward Assignment Request Body", + "title": "Coin Reward", "oneOf": [ - { - "properties": { - "campaign": { - "type": "string", - "description": "The campaign ID of the campaign to which the reward is to be assigned." - }, - "parameters": { - "type": "object", - "description": "Defines the cost of the reward.", - "required": [ - "loyalty" - ], - "properties": { - "loyalty": { - "type": "object", - "description": "Defines the equivalent points value of the reward.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points that will be subtracted from the loyalty card points balance if the reward is redeemed." - } - } - } - } - } - }, - "required": [ - "campaign", - "parameters" - ] - }, { "properties": { "campaign": { @@ -29836,7 +29827,7 @@ "$ref": "#/components/schemas/4_obj_reward_assignment_object" } }, - "8_req_update_reward_assignment": { + "rewards_update_assignment_request_body": { "title": "Update Reward Assignment Request Body", "type": "object", "description": "Request body schema for **PUT** `/loyalties/{campaignId}/rewards/{assignmentId}`.", @@ -54789,7 +54780,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + "$ref": "#/components/schemas/reward_assignment" } } } From 9e8b762631969658aa896dda696480251989c345 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Mon, 16 Oct 2023 10:01:08 +0200 Subject: [PATCH 08/20] Update OpenAPI.json --- reference/OpenAPI.json | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 97ec10505..a87320cf5 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -10541,6 +10541,7 @@ }, "reward_assignment": { "title": "Reward Assignment Object", + "type": "object", "description": "This is an object representing a reward assignment.", "x-tags": [ "REWARDS API" @@ -10638,18 +10639,14 @@ "rewards_create_assignment_coin_reward_request_body": { "description": "Request body schema for **POST** `/rewards/{rewardID}/assignments`.", "title": "Coin Reward", - "oneOf": [ - { - "properties": { - "campaign": { - "type": "string", - "description": "The campaign ID of the campaign to which the reward is to be assigned." - } - }, - "required": [ - "campaign" - ] + "properties": { + "campaign": { + "type": "string", + "description": "The campaign ID of the campaign to which the reward is to be assigned." } + }, + "required": [ + "campaign" ], "type": "object" }, @@ -41398,7 +41395,7 @@ "$ref": "#/components/schemas/RewardTypeCoin" }, { - "$ref": "#/components/schemas/RewardTypeCoin" + "$ref": "#/components/schemas/RewardTypeMaterial" } ] }, From 32921ad632ee6eb68cff755d2584ca03eb988159 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Mon, 16 Oct 2023 12:24:18 +0200 Subject: [PATCH 09/20] update changelog --- Changelog.md | 59 ++++++++++++++++++++++++++++++++++++++++++ reference/OpenAPI.json | 8 ++---- 2 files changed, 61 insertions(+), 6 deletions(-) diff --git a/Changelog.md b/Changelog.md index da4deaaf3..8658125ac 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,64 @@ # Changelog +## 20231016 - Rewards + +**New models** +- reward +- reward_base +- reward_identity +- reward_response_data +- reward_parameters + +- reward_parameters_CAMPAIGN +- reward_parameters_COIN +- reward_parameters_MATERIAL +- reward_assignment +- reward_assignment_base +- reward_assignment_identity +- reward_assignment_response_data +- rewards_list_assignments_response_body +- rewards_create_assignment_request_body +- rewards_create_assignment_coin_reward_request_body +- rewards_create_assignment_main_reward_request_body +- rewards_update_assignment_request_body + +**Endpoint changes** +- Added missing method for endpoint: GET `/v1/rewards/{rewardId)}/assignments/{assignmentId}` + - Response body schema: `reward_assignment` +- GET `/v1/rewards/{rewardId}/assignments` (listAssignments) + - New response schema: `rewards_list_assignments_response_body` (old one: `4_res_list_reward_assignments`) +- POST `/v1/rewards/{rewardId}/assignments` (createAssignment) + - New request schema: `rewards_create_assignment_request_body` (old one: `4_req_create_reward_assignment`) + - New response schema: `reward_assignment` (old one: `4_obj_reward_assignment_object`) +- PUT `/v1/rewards/{rewardId}/assignments/{assignmentId}` (updateAssignment) + - New request schema: `rewards_update_assignment_request_body` (old one: `4_req_update_reward_assignment`) + - New response schema: `reward_assignment` (old one: `4_obj_reward_assignment_object`) + +## 20231016 - Loyalties + +**New models** +- reward +- reward_base +- reward_identity +- reward_response_data +- reward_parameters + +- reward_parameters_CAMPAIGN +- reward_parameters_COIN +- reward_parameters_MATERIAL +- reward_assignment +- reward_assignment_base +- reward_assignment_identity +- reward_assignment_response_data +- loyalties_list_loyalty_tier_rewards_response_body +- loyalties_loyalty_tier_reward (old one: `8_obj_loyalty_tier_reward_object`) +- + +**Endpoint changes** +- Added missing method for endpoint: GET `/v1/loyalties/{campaignId)}/rewards/{assignmentId}` + - Response body schema: `reward_assignment` +- Added missing method for endpoint: GET `/v1/loyalties/{campaignId)}/tiers/{tierId}/rewards` + - Response body schema: `loyalties_list_loyalty_tier_rewards_response_body` ## 20231012 - Product Collections diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index a87320cf5..cd57ac815 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -9593,7 +9593,7 @@ ] }, "reward": { - "title": "Reward Object", + "title": "Reward", "type": "object", "description": "This is an object representing a reward.", "x-tags": [ @@ -10540,12 +10540,8 @@ ] }, "reward_assignment": { - "title": "Reward Assignment Object", + "title": "Reward Assignment", "type": "object", - "description": "This is an object representing a reward assignment.", - "x-tags": [ - "REWARDS API" - ], "allOf": [ { "$ref": "#/components/schemas/reward_assignment_base" From 78fa8f8590a7a0db8dc26a858cb0a49dffcb5dca Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Mon, 16 Oct 2023 12:30:30 +0200 Subject: [PATCH 10/20] change order of components --- reference/OpenAPI.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index cd57ac815..90ca96c40 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -9594,25 +9594,25 @@ }, "reward": { "title": "Reward", - "type": "object", "description": "This is an object representing a reward.", "x-tags": [ "REWARDS API" ], "allOf": [ - { - "$ref": "#/components/schemas/reward_base" - }, { "$ref": "#/components/schemas/reward_identity" }, { - "$ref": "#/components/schemas/reward_response_data" + "$ref": "#/components/schemas/reward_base" }, { "$ref": "#/components/schemas/reward_parameters" + }, + { + "$ref": "#/components/schemas/reward_response_data" } - ] + ], + "type": "object" }, "4_obj_reward_object": { "title": "Reward Object", @@ -10541,18 +10541,18 @@ }, "reward_assignment": { "title": "Reward Assignment", - "type": "object", "allOf": [ { - "$ref": "#/components/schemas/reward_assignment_base" + "$ref": "#/components/schemas/reward_assignment_identity" }, { - "$ref": "#/components/schemas/reward_assignment_identity" + "$ref": "#/components/schemas/reward_assignment_base" }, { "$ref": "#/components/schemas/reward_assignment_response_data" } - ] + ], + "type": "object" }, "rewards_list_assignments_response_body": { "type": "object", From 37ebcdb3ce83650f571071c80ba6a911891487f6 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:11:00 +0200 Subject: [PATCH 11/20] separate the coin reward assignment and campaign/material reward assignment --- reference/OpenAPI.json | 102 ++++++++++++++++++++++++++++++----------- 1 file changed, 76 insertions(+), 26 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 90ca96c40..88e5ec1d3 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -10452,28 +10452,6 @@ "enum": [ "campaign" ] - }, - "parameters": { - "description": "Defines the cost of the reward.", - "type": "object", - "properties": { - "loyalty": { - "type": "object", - "description": "Defines the equivalent points value of the reward.", - "required": [ - "points" - ], - "properties": { - "points": { - "type": "integer", - "description": "The number of points required to redeem the reward." - } - } - } - }, - "required": [ - "loyalty" - ] } }, "required": [ @@ -10539,8 +10517,54 @@ "object" ] }, + "reward_assignment_campaign_and_material_reward_parameters": { + "title": "Reward Assignment Campaign and MAterial Reward Parameters", + "type": "object", + "x-tags": [ + "REWARDS API" + ], + "properties": { + "parameters": { + "description": "Defines the cost of the reward.", + "type": "object", + "properties": { + "loyalty": { + "type": "object", + "description": "Defines the equivalent points value of the reward.", + "required": [ + "points" + ], + "properties": { + "points": { + "type": "integer", + "description": "The number of points required to redeem the reward." + } + } + } + }, + "required": [ + "loyalty" + ] + } + }, + "required": [ + "parameters" + ] + }, "reward_assignment": { "title": "Reward Assignment", + "oneOf": [ + { + "$ref": "#/components/schemas/reward_assignment_coin_reward" + }, + { + "$ref": "#/components/schemas/reward_assignment_campaign_and_material_reward" + } + ], + "type": "object" + }, + "reward_assignment_coin_reward": { + "title": "Reward Assignment - Coin Reward", "allOf": [ { "$ref": "#/components/schemas/reward_assignment_identity" @@ -10554,6 +10578,24 @@ ], "type": "object" }, + "reward_assignment_campaign_and_material_reward": { + "title": "Reward Assignment - Campaign and Material Reward", + "allOf": [ + { + "$ref": "#/components/schemas/reward_assignment_identity" + }, + { + "$ref": "#/components/schemas/reward_assignment_base" + }, + { + "$ref": "#/components/schemas/reward_assignment_response_data" + }, + { + "$ref": "#/components/schemas/reward_assignment_campaign_and_material_reward_parameters" + } + ], + "type": "object" + }, "rewards_list_assignments_response_body": { "type": "object", "description": "Response body schema for **GET** `/rewards/{rewardID}/assignments`.", @@ -10592,14 +10634,14 @@ "title": "Create Reward Assignment Request Body", "oneOf": [ { - "$ref": "#/components/schemas/rewards_create_assignment_main_reward_request_body" + "$ref": "#/components/schemas/rewards_create_assignment_campaign_and_material_reward_request_body" }, { "$ref": "#/components/schemas/rewards_create_assignment_coin_reward_request_body" } ] }, - "rewards_create_assignment_main_reward_request_body": { + "rewards_create_assignment_campaign_and_material_reward_request_body": { "description": "Request body schema for **POST** `/rewards/{rewardID}/assignments`.", "title": "Main Reward", "properties": { @@ -10635,16 +10677,24 @@ "rewards_create_assignment_coin_reward_request_body": { "description": "Request body schema for **POST** `/rewards/{rewardID}/assignments`.", "title": "Coin Reward", + "type": "object", "properties": { "campaign": { "type": "string", "description": "The campaign ID of the campaign to which the reward is to be assigned." + }, + "validation_rules": { + "type": "array", + "items": { + "type": "string", + "maxLength": 1, + "minLength": 0 + } } }, "required": [ "campaign" - ], - "type": "object" + ] }, "5_obj_publication_object": { "title": "Publication Object", From 6076878a98725a8b01158795c438b23e1db79bd7 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:33:53 +0200 Subject: [PATCH 12/20] replace "Reward" wih "reward" --- reference/OpenAPI.json | 196 ++--------------------------------------- 1 file changed, 8 insertions(+), 188 deletions(-) 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": { From 055876262a703ab7a6aa1cc840b203a4086ce889 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:38:54 +0200 Subject: [PATCH 13/20] replace RewardAssignemnt with reward_assignment --- reference/OpenAPI.json | 245 ++++++++++++++++------------------------- 1 file changed, 92 insertions(+), 153 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 73fa0fd31..16b77a981 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -9465,123 +9465,6 @@ } } }, - "reward_base": { - "title": "Reward Object Base", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "stock": { - "type": [ - "integer", - "null" - ], - "description": "Configurable for **material rewards**. The number of units of the product that you want to share as reward." - }, - "redeemed": { - "type": [ - "integer", - "null" - ], - "description": "Defines the number of already invoked (successful) reward redemptions.\t" - }, - "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." - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format." - } - }, - "required": [ - "name", - "stock", - "redeemed", - "attributes", - "metadata" - ] - }, - "reward_identity": { - "title": "Reward Object Identity", - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "rew_nIy4gHpQHle2c3pNMwuj7G6j", - "description": "Unique reward ID, assigned by Voucherify." - } - }, - "required": [ - "id" - ] - }, - "reward_response_data": { - "title": "Reward Object Response Data", - "type": "object", - "properties": { - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the reward was created in ISO 8601 format.", - "example": "2022-08-11T14:49:22.586Z", - "format": "date-time" - }, - "updated_at": { - "type": [ - "string", - "null" - ], - "description": "Timestamp representing the date and time when the reward was updated in ISO 8601 format.", - "example": "2022-08-11T16:01:34.885Z", - "format": "date-time" - }, - "object": { - "description": "The type of object represented by the JSON. This object stores information about the reward.", - "enum": [ - "reward" - ] - } - }, - "required": [ - "created_at", - "updated_at", - "object" - ] - }, - "reward": { - "title": "Reward", - "description": "This is an object representing a reward.", - "x-tags": [ - "REWARDS API" - ], - "allOf": [ - { - "$ref": "#/components/schemas/reward_identity" - }, - { - "$ref": "#/components/schemas/reward_base" - }, - { - "$ref": "#/components/schemas/reward_type" - }, - { - "$ref": "#/components/schemas/reward_response_data" - } - ], - "type": "object" - }, "4_obj_reward_object": { "title": "Reward Object", "type": "object", @@ -41190,64 +41073,120 @@ "user_id" ] }, - "RewardAssignment": { - "title": "Reward Assignment", + "reward": { + "title": "Reward", + "description": "This is an object representing a reward.", + "x-tags": [ + "REWARDS API" + ], + "allOf": [ + { + "$ref": "#/components/schemas/reward_identity" + }, + { + "$ref": "#/components/schemas/reward_base" + }, + { + "$ref": "#/components/schemas/reward_type" + }, + { + "$ref": "#/components/schemas/reward_response_data" + } + ], + "type": "object" + }, + "reward_base": { + "title": "Reward Object Base", "type": "object", "properties": { - "id": { - "type": "string", - "description": "Unique reward assignment ID, assigned by Voucherify." - }, - "reward_id": { + "name": { "type": "string", - "description": "Associated reward ID." + "description": "Reward name." }, - "related_object_id": { - "type": "string", - "description": "Related object ID to which the reward was assigned." + "stock": { + "type": [ + "integer", + "null" + ], + "description": "Configurable for **material rewards**. The number of units of the product that you want to share as reward." }, - "related_object_type": { - "type": "string", - "description": "Related object type to which the reward was assigned." + "redeemed": { + "type": [ + "integer", + "null" + ], + "description": "Defines the number of already invoked (successful) reward redemptions.\t" }, - "parameters": { + "attributes": { "type": "object", - "description": "Defines the cost of the reward.", + "description": "These properties are configurable for **material rewards**.", "properties": { - "loyalty": { - "type": "object", - "description": "Defines the equivalent points value of the reward.", - "properties": { - "points": { - "type": "integer", - "description": "The number of points required to redeem the reward." - } - }, - "required": [ - "points" - ] + "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." } } }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format." + } + }, + "required": [ + "name", + "stock", + "redeemed", + "attributes", + "metadata" + ] + }, + "reward_identity": { + "title": "Reward Object Identity", + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "rew_nIy4gHpQHle2c3pNMwuj7G6j", + "description": "Unique reward ID, assigned by Voucherify." + } + }, + "required": [ + "id" + ] + }, + "reward_response_data": { + "title": "Reward Object Response Data", + "type": "object", + "properties": { "created_at": { "type": "string", - "description": "Timestamp representing the date and time when the reward assignment was created in ISO 8601 format.", + "description": "Timestamp representing the date and time when the reward was created in ISO 8601 format.", + "example": "2022-08-11T14:49:22.586Z", "format": "date-time" }, "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the reward assignment was updated in ISO 8601 format.", + "type": [ + "string", + "null" + ], + "description": "Timestamp representing the date and time when the reward was updated in ISO 8601 format.", + "example": "2022-08-11T16:01:34.885Z", "format": "date-time" }, "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the reward assignment." + "description": "The type of object represented by the JSON. This object stores information about the reward.", + "enum": [ + "reward" + ] } }, "required": [ - "id", - "reward_id", "created_at", + "updated_at", "object" ] }, @@ -43629,7 +43568,7 @@ } }, "LoyaltiesGetRewardAssignmentResponseBody": { - "$ref": "#/components/schemas/RewardAssignment" + "$ref": "#/components/schemas/reward_assignment" }, "LoyaltiesGetRewardDetailsResponseBody": { "$ref": "#/components/schemas/Reward" From b70a2a67b227095957d0fa2b48ea7bbe5359afac Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:14:52 +0200 Subject: [PATCH 14/20] Update OpenAPI.json --- reference/OpenAPI.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 16b77a981..f05de7436 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -10284,7 +10284,7 @@ ] }, "reward_assignment_campaign_and_material_reward_parameters": { - "title": "Reward Assignment Campaign and MAterial Reward Parameters", + "title": "Reward Assignment Campaign or Material Reward Parameters", "type": "object", "x-tags": [ "REWARDS API" @@ -10345,7 +10345,7 @@ "type": "object" }, "reward_assignment_campaign_and_material_reward": { - "title": "Reward Assignment - Campaign and Material Reward", + "title": "Reward Assignment - Campaign or Material Reward", "allOf": [ { "$ref": "#/components/schemas/reward_assignment_identity" @@ -43571,7 +43571,7 @@ "$ref": "#/components/schemas/reward_assignment" }, "LoyaltiesGetRewardDetailsResponseBody": { - "$ref": "#/components/schemas/Reward" + "$ref": "#/components/schemas/reward" }, "LoyaltiesListTiersRequestQuery": { "title": "Loyalties List Tiers Request Query", From 75e16ebe62ede36cff62abf638566bc81cf0dbcc Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 19 Oct 2023 09:55:58 +0200 Subject: [PATCH 15/20] Update OpenAPI.json --- reference/OpenAPI.json | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index f05de7436..73f9870ff 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -10452,9 +10452,7 @@ "validation_rules": { "type": "array", "items": { - "type": "string", - "maxLength": 1, - "minLength": 0 + "type": "string" } } }, @@ -41074,11 +41072,6 @@ ] }, "reward": { - "title": "Reward", - "description": "This is an object representing a reward.", - "x-tags": [ - "REWARDS API" - ], "allOf": [ { "$ref": "#/components/schemas/reward_identity" @@ -41087,17 +41080,16 @@ "$ref": "#/components/schemas/reward_base" }, { - "$ref": "#/components/schemas/reward_type" + "$ref": "#/components/schemas/reward_response_data" }, { - "$ref": "#/components/schemas/reward_response_data" + "$ref": "#/components/schemas/reward_type" } - ], - "type": "object" + ] }, "reward_base": { - "title": "Reward Object Base", "type": "object", + "title": "Reward Base", "properties": { "name": { "type": "string", @@ -41145,8 +41137,8 @@ ] }, "reward_identity": { - "title": "Reward Object Identity", "type": "object", + "title": "Reward Identity", "properties": { "id": { "type": "string", @@ -41159,8 +41151,8 @@ ] }, "reward_response_data": { - "title": "Reward Object Response Data", "type": "object", + "title": "Reward Response Data", "properties": { "created_at": { "type": "string", From 1758675ab9976ff4d835121dfb25383c40040480 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:29:12 +0200 Subject: [PATCH 16/20] reward_response_data -> reward_created --- reference/OpenAPI.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 73f9870ff..6a2cf8d64 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -41080,7 +41080,7 @@ "$ref": "#/components/schemas/reward_base" }, { - "$ref": "#/components/schemas/reward_response_data" + "$ref": "#/components/schemas/reward_created" }, { "$ref": "#/components/schemas/reward_type" @@ -41150,7 +41150,7 @@ "id" ] }, - "reward_response_data": { + "reward_created": { "type": "object", "title": "Reward Response Data", "properties": { From 04411083f841b462feb7aff4d9a31e9b52dfa433 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:51:53 +0200 Subject: [PATCH 17/20] changes in script --- scripts/manage-project.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index 4002e5099..50c6493b1 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -80,11 +80,11 @@ const isVersionExists = async (version: string) => { const uploadReferenceDocsWithMaxNumberOfAttempts = async ( version, - maxNumberOfUploadingAttempts = 6 + maxNumberOfUploadingAttempts = 3 ) => { console.log(colors.green("UPLOADING REFERENCE DOC FILES...")); for (let i = 1; i <= maxNumberOfUploadingAttempts; i++) { - await new Promise((r) => setTimeout(r, 5000)); + await new Promise((r) => setTimeout(r, 10000)); const success = await runCliProcess({ command: `rdme docs ./docs/reference-docs --version=${version}`, stdoutIncludes: "successfully created", @@ -122,12 +122,12 @@ const runCliProcess = async ({ ) { return resolve(true); } + if (stderr) { + console.log("Error: \n", stderr) + } if (resolveErrorAsFalse) { return resolve(false); } - if (stderr) { - console.log(stderr); - } throw error; }); }); @@ -230,7 +230,7 @@ const cleanProject = async (version) => { ); console.log(colors.green(`REFERENCE CATEGORIES UPDATED!`)); const allApiSpecifications = await getAllApiSpecifications(version); - await asyncMap(allApiSpecifications, deleteSpecification); + await asyncMap(allApiSpecifications, (apiSpecification) => deleteSpecification(apiSpecification.id)); console.log(colors.green(`API SPECIFICATIONS DELETED!`)); console.log(colors.green(`VERSION "${version}" IS CLEANED UP!`)); return; From 2082d564abc68d9c3080da5f5add887f1e32dcb4 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:04:36 +0200 Subject: [PATCH 18/20] ok version --- reference/OpenAPI.json | 101 +++++++++++++---------------------------- 1 file changed, 32 insertions(+), 69 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 6a2cf8d64..892153a96 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -41081,15 +41081,11 @@ }, { "$ref": "#/components/schemas/reward_created" - }, - { - "$ref": "#/components/schemas/reward_type" } ] }, "reward_base": { "type": "object", - "title": "Reward Base", "properties": { "name": { "type": "string", @@ -41126,10 +41122,34 @@ "metadata": { "type": "object", "description": "The metadata object stores all custom attributes assigned to the reward. A set of key/value pairs that you can attach to a reward object. It can be useful for storing additional information about the reward in a structured format." + }, + "type": { + "type": "string", + "enum": [ + "CAMPAIGN", + "COIN", + "MATERIAL" + ], + "description": "Reward type." + }, + "parameters": { + "oneOf": [ + { + "$ref": "#/components/schemas/reward_type_campaign" + }, + { + "$ref": "#/components/schemas/reward_type_coin" + }, + { + "$ref": "#/components/schemas/reward_type_material" + } + ], + "description": "Defines how the reward is generated." } }, "required": [ "name", + "type", "stock", "redeemed", "attributes", @@ -41138,7 +41158,6 @@ }, "reward_identity": { "type": "object", - "title": "Reward Identity", "properties": { "id": { "type": "string", @@ -41152,7 +41171,6 @@ }, "reward_created": { "type": "object", - "title": "Reward Response Data", "properties": { "created_at": { "type": "string", @@ -41183,8 +41201,7 @@ ] }, "reward_type": { - "title": "Reward Type", - "anyOf": [ + "oneOf": [ { "$ref": "#/components/schemas/reward_type_campaign" }, @@ -41197,22 +41214,8 @@ ] }, "reward_type_coin": { - "title": "Reward Type Coin", + "title": "Reward Type - Coin", "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "COIN" - ], - "description": "Reward type." - }, - "parameters": { - "type": "object", - "required": [ - "coin" - ], - "description": "Defines how the reward is generated.", "properties": { "coin": { "type": "object", @@ -41231,31 +41234,11 @@ } } } - } - } - }, - "required": [ - "type", - "parameters" - ] - }, + }, "required": ["coin"] + }, "reward_type_material": { - "title": "Reward Type Material", + "title": "Reward Type - Material", "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "MATERIAL" - ], - "description": "Reward type." - }, - "parameters": { - "type": "object", - "required": [ - "product" - ], - "description": "Defines how the reward is generated.", "properties": { "product": { "type": "object", @@ -41278,31 +41261,14 @@ } } } - } - } }, "required": [ - "type", - "parameters" + "product" ] }, "reward_type_campaign": { - "title": "Reward Type Campaign", + "title": "Reward Type - Campaign", "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "CAMPAIGN" - ], - "description": "Reward type." - }, - "parameters": { - "type": "object", - "required": [ - "campaign" - ], - "description": "Defines how the reward is generated.", "properties": { "campaign": { "type": "object", @@ -41332,12 +41298,9 @@ } } } - } - } }, "required": [ - "type", - "parameters" + "campaign" ] }, "LoyaltiesAddOrRemoveCardBalanceResponseBody": { From 1fcf4df30cd96052c803b41674edd6c0e2a68e45 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:07:00 +0200 Subject: [PATCH 19/20] Update OpenAPI.json --- reference/OpenAPI.json | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 892153a96..f7d12c051 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -41133,17 +41133,7 @@ "description": "Reward type." }, "parameters": { - "oneOf": [ - { - "$ref": "#/components/schemas/reward_type_campaign" - }, - { - "$ref": "#/components/schemas/reward_type_coin" - }, - { - "$ref": "#/components/schemas/reward_type_material" - } - ], + "$ref": "#/components/schemas/reward_type", "description": "Defines how the reward is generated." } }, From 97239f8bcd793f50ac064372c6d103df6b7452b2 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 20 Oct 2023 09:42:13 +0200 Subject: [PATCH 20/20] update desc in create reward assignemnt --- reference/OpenAPI.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index f7d12c051..ebd9a7ef1 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -10409,7 +10409,7 @@ }, "rewards_create_assignment_campaign_and_material_reward_request_body": { "description": "Request body schema for **POST** `/rewards/{rewardID}/assignments`.", - "title": "Main Reward", + "title": "Reward Assignment - Campaign Or Material Reward", "properties": { "campaign": { "type": "string", @@ -10442,7 +10442,7 @@ }, "rewards_create_assignment_coin_reward_request_body": { "description": "Request body schema for **POST** `/rewards/{rewardID}/assignments`.", - "title": "Coin Reward", + "title": "Reward Assignment - Coin Reward", "type": "object", "properties": { "campaign": {